updated pycrypto

This commit is contained in:
shim_
2018-05-10 16:56:32 +02:00
parent fb89f1946b
commit 26579a25f1
92 changed files with 2518 additions and 5288 deletions

View File

@@ -29,8 +29,7 @@ import unittest
from Crypto.PublicKey import RSA
from Crypto import Random
from Crypto.SelfTest.st_common import list_test_cases, a2b_hex, b2a_hex
from Crypto.Hash import SHA1, MD2, RIPEMD160, SHA224, SHA384, SHA512,\
SHA256, MD5
from Crypto.Hash import *
from Crypto.Signature import PKCS1_PSS as PKCS
from Crypto.Util.py3compat import *
@@ -137,7 +136,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
'''e3 b5 d5 d0 02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8
3b ce 7e 61''',
# Hash algorithm
SHA1
SHA
),
#
@@ -193,7 +192,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
'''de e9 59 c7 e0 64 11 36 14 20 ff 80 18 5e d5 7f
3e 67 76 af''',
# Hash
SHA1
SHA
),
#
@@ -239,7 +238,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
'''ef 28 69 fa 40 c3 46 cb 18 3d ab 3d 7b ff c9 8f
d5 6d f4 2d''',
# Hash
SHA1
SHA
),
#
@@ -286,7 +285,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
# Salt
'''57 bf 16 0b cb 02 bb 1d c7 28 0c f0 45 85 30 b7
d2 83 2f f7''',
SHA1
SHA
),
#
@@ -340,7 +339,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
# Salt
'''1d 65 49 1d 79 c8 64 b3 73 00 9b e6 f6 f2 46 7b
ac 4c 78 fa''',
SHA1
SHA
)
)
@@ -381,12 +380,12 @@ class PKCS1_PSS_Tests(unittest.TestCase):
self.failUnless(result)
def testSignVerify(self):
h = SHA1.new()
h = SHA.new()
h.update(b('blah blah blah'))
rng = Random.new().read
key = MyKey(RSA.generate(1024,rng))
# Helper function to monitor what's request from MGF
global mgfcalls
def newMGF(seed,maskLen):
@@ -395,7 +394,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
return bchr(0x00)*maskLen
# Verify that PSS is friendly to all ciphers
for hashmod in (MD2,MD5,SHA1,SHA224,SHA256,SHA384,RIPEMD160):
for hashmod in (MD2,MD5,SHA,SHA224,SHA256,SHA384,RIPEMD):
h = hashmod.new()
h.update(b('blah blah blah'))
@@ -407,7 +406,7 @@ class PKCS1_PSS_Tests(unittest.TestCase):
self.failUnless(signer.verify(h, s))
self.assertEqual(key.asked, h.digest_size)
h = SHA1.new()
h = SHA.new()
h.update(b('blah blah blah'))
# Verify that sign() uses a different salt length