Пример #1
0
 def test_inverse(self):
     f_my_private = top.f_private(self.privkey)
     f_my_public = top.f_public(self.privkey)
     self.assertEqual(MSG1, f_my_public(f_my_private(MSG1)))
     self.assertEqual(MSG1, f_my_private(f_my_public(MSG1)))
     self.assertNotEqual(MSG1, f_my_public(f_my_public(MSG1)))
     self.assertNotEqual(MSG1, f_my_private(f_my_private(MSG1)))
Пример #2
0
 def test_public(self):
     f_my_public = top.f_public(self.pubkey)
     self.assertTrue(f_my_public(MSG1))
     f_my_public2 = top.f_public(self.privkey)
     self.assertTrue(f_my_public2(MSG1))