diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2020-01-12 21:42:21 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2020-01-12 22:42:21 -0500 |
commit | c0dbbb52fbcae313a566285f44e6e4b2820baaf7 (patch) | |
tree | 418e983f5570c06644d0d7ee9be6a4ccec1ddd2f /tests | |
parent | c8c78bb4c57b3be68b3779c2ad5bab0c7122fbf2 (diff) | |
download | cryptography-c0dbbb52fbcae313a566285f44e6e4b2820baaf7.tar.gz cryptography-c0dbbb52fbcae313a566285f44e6e4b2820baaf7.tar.bz2 cryptography-c0dbbb52fbcae313a566285f44e6e4b2820baaf7.zip |
Refs #5075 -- use ecdsa_*.json from wycheproof (#5099)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wycheproof/test_ecdsa.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/wycheproof/test_ecdsa.py b/tests/wycheproof/test_ecdsa.py index 5214052e..14542ed7 100644 --- a/tests/wycheproof/test_ecdsa.py +++ b/tests/wycheproof/test_ecdsa.py @@ -20,6 +20,10 @@ _DIGESTS = { "SHA-256": hashes.SHA256(), "SHA-384": hashes.SHA384(), "SHA-512": hashes.SHA512(), + "SHA3-224": hashes.SHA3_224(), + "SHA3-256": hashes.SHA3_256(), + "SHA3-384": hashes.SHA3_384(), + "SHA3-512": hashes.SHA3_512(), } @@ -34,13 +38,23 @@ _DIGESTS = { "ecdsa_secp224r1_sha224_test.json", "ecdsa_secp224r1_sha256_test.json", "ecdsa_secp224r1_sha512_test.json", + "ecdsa_secp224r1_sha3_224_test.json", + "ecdsa_secp224r1_sha3_256_test.json", + "ecdsa_secp224r1_sha3_512_test.json", "ecdsa_secp256k1_sha256_test.json", "ecdsa_secp256k1_sha512_test.json", + "ecdsa_secp256k1_sha3_256_test.json", + "ecdsa_secp256k1_sha3_512_test.json", "ecdsa_secp256r1_sha256_test.json", "ecdsa_secp256r1_sha512_test.json", + "ecdsa_secp256r1_sha3_256_test.json", + "ecdsa_secp256r1_sha3_512_test.json", "ecdsa_secp384r1_sha384_test.json", "ecdsa_secp384r1_sha512_test.json", + "ecdsa_secp384r1_sha3_384_test.json", + "ecdsa_secp384r1_sha3_512_test.json", "ecdsa_secp521r1_sha512_test.json", + "ecdsa_secp521r1_sha3_512_test.json", ) def test_ecdsa_signature(backend, wycheproof): try: @@ -58,6 +72,9 @@ def test_ecdsa_signature(backend, wycheproof): ) digest = _DIGESTS[wycheproof.testgroup["sha"]] + if not backend.hash_supported(digest): + pytest.skip("Hash {} not supported".format(digest)) + if ( wycheproof.valid or (wycheproof.acceptable and not wycheproof.has_flag("MissingZero")) |