コード例 #1
0
 def test_gost_dec(self):
     mtest = list(binascii.unhexlify('1122334455667700ffeeddccbbaa9988'))
     ktest = list(binascii.unhexlify('8899aabbccddeeff0011223344556677fedcba98765432100123456789abcdef'))
     gost =gost2015(ktest)
     c = gost.encryption(mtest)
     d = gost.decryption(c)
     self.assertEqual(binascii.hexlify(bytearray(d)), b'1122334455667700ffeeddccbbaa9988')
コード例 #2
0
def test_gost_enc():
    mtest = list(binascii.unhexlify('1122334455667700ffeeddccbbaa9988'))
    ktest = list(
        binascii.unhexlify(
            '8899aabbccddeeff0011223344556677fedcba98765432100123456789abcdef')
    )
    gost = gost2015(ktest)
    c = gost.encryption(mtest)
    assert binascii.hexlify(bytearray(c)), b'7f679d90bebc24305a468d42b9d4edcd'
コード例 #3
0
ファイル: tests.py プロジェクト: Iv/Cryptography-standards
 def test_gost_enc(self):
     mtest = list(binascii.unhexlify('1122334455667700ffeeddccbbaa9988'))
     ktest = list(binascii.unhexlify('8899aabbccddeeff0011223344556677fedcba98765432100123456789abcdef'))
     gost =gost2015(ktest)
     c = gost.encryption(mtest)
     self.assertEqual(binascii.hexlify(bytearray(c)), b'7f679d90bebc24305a468d42b9d4edcd')