aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRené Korthaus <[email protected]>2017-02-12 12:38:10 +0100
committerRené Korthaus <[email protected]>2017-02-12 12:38:10 +0100
commitd7990d845e7f7ab98b61de9b651a9afe96d6d873 (patch)
tree9c07a3e903e610ecc02fd01deb5405d485c52be2
parent40216bb25e8d20f195f31f137129db7edc06fc3c (diff)
Add test vectors for invalid ECDSA public keys from FIPS 186-4
-rw-r--r--src/tests/data/pubkey/ecdsa_invalid.vec184
-rw-r--r--src/tests/test_ecdsa.cpp1
2 files changed, 185 insertions, 0 deletions
diff --git a/src/tests/data/pubkey/ecdsa_invalid.vec b/src/tests/data/pubkey/ecdsa_invalid.vec
index d85fdd695..b4c8b6663 100644
--- a/src/tests/data/pubkey/ecdsa_invalid.vec
+++ b/src/tests/data/pubkey/ecdsa_invalid.vec
@@ -184,4 +184,188 @@ InvalidKeyY = 0x187333ce6fe5e6dea5d08d8f5950b5207cb8eb34fa0de2cae5acad8bc8436ff6
# TODO check FIPS 186-4
+# Public keys failing checks from NIST CAVS file 11.0 (Generated on Wed Mar 16 16:16:42 2011)
+# http://csrc.nist.gov/groups/STM/cavp/documents/dss/186-3ecdsatestvectors.zip
+
+# [P-192]
+
+Group = secp192r1
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x472a620598e6715eff9cc022805d8cc8e8219f0e32042538
+InvalidKeyY = 0x1971ca86edb3471b2a16b9aae9de90f366f371b26385027e6
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x192a2b854bf4e70d5a8fecc98f43b4a744b26808f8cf4c60d
+InvalidKeyY = 0x2c0b29190588eabf08dfe160ac8d3ab6f5d5cc73678ebae8
+
+# Point not on curve
+InvalidKeyX = 0xc07ce28e4c846d7327f0554119ddb7e865fa1dd448ba2b40
+InvalidKeyY = 0x33aefa3177b99901d9ab6c12eb0749197420296ccb9d4e4a
+
+# Point not on curve
+InvalidKeyX = 0xf77c2e5946d99932b2a01c1c73a296ecde568978103d8e2b
+InvalidKeyY = 0xde46b2d5c94dc11b53578eafaa23f96de9747b086979416c
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x1016451af3e7a7fa2ce3cf2acbe07fa7fa19a5f14455bf2ec
+InvalidKeyY = 0xc074630aea063e00bb41e6fbf752dd4f8e5bc742bf3363eb
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x18eea61787fbcd90f73f947346cdf13f05b4170e3e7456165
+InvalidKeyY = 0x5514c7b6e0eecc4e9c1ad99710f009a550bf3f952bb16593
+
+# Point not on curve
+InvalidKeyX = 0x39ed11c88869f6c4705125d9d5fc7c6b1e3d22b2fa7a6b57
+InvalidKeyY = 0xd0cf50208f6b1a61ba346a3f3f8f58128c8199e5405a6f11
+
+# Point not on curve
+InvalidKeyX = 0x87d67f9b7cced918d827ffc086cfd6a181fc61b2f56e000b
+InvalidKeyY = 0xc6c8d686c61a816d25c085db665f018e31ad6f71ee24d895
+
+[P-224]
+
+Group = secp224r1
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x7a9369e2173bbf29589bf47e3ae0ccf47df6d2268c2292f906cc9261
+InvalidKeyY = 0x11afc53c7c1b085029f53b41fcd5a336bafb35b89d302f2bd04df44e6
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x1803faeef9b40957f59ab97d543f86690afd7471dfb8b04b84ea31085
+InvalidKeyY = 0x738cc29474ca048930b7f1a29db3773d11839ed83a6993e3f23692d7
+
+# Point not on curve
+InvalidKeyX = 0xc01795a001b6b8a5b3db9acbdb55c2f97f4a50aa0a0cfed1d50a4c28
+InvalidKeyY = 0xb79dbe52a47a4640100cc939b435377f0bcb8db4ec52ecaadac5d919
+
+# Point not on curve
+InvalidKeyX = 0xfbe3bff58dc58ca1ef9dc942fd43cdadbd060d70e0b1e6b9583a2228
+InvalidKeyY = 0xca844b43c237d497c34b986c681bf3cc54f968c0db74b2e1d9fe9d94
+
+# Point not on curve
+InvalidKeyX = 0xcbe83c33848dd5a89ea8c45d23b99f23254e2077bd9ab26f6b5bed9f
+InvalidKeyY = 0xc0d09533d78a96e39028162534d74b097364095e2dc60776938af83b
+
+# Point not on curve
+InvalidKeyX = 0x491e8d6c73708104c9530878f866e585cba008ef70baa46a809a2c03
+InvalidKeyY = 0x924a28ace8db9a88f7f874a1f24ac7f0bf56484f2130d5be5a8a1721
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x1a89dc6a91002c9d25a3c4621fb5606b52531fd8e48a44119f442f749
+InvalidKeyX = 0x62f556641faa83059425026ca18ecbd219fe6d5df3b7713ce8b168cd
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x182a4cee32c06292556f4e29950f5b2db9ad627a56e92680358d6cac4
+InvalidKeyY = 0xfa2a87aa3757ae9fa00d11db57089632c4f9e33fb214b9324cf75bd9
+
+[P-256]
+
+Group = secp256r1
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0xd17c446237d9df87266ba3a91ff27f45abfdcb77bfd83536e92903efb861a9a9
+InvalidKeyY = 0x1eabb6a349ce2cd447d777b6739c5fc066add2002d2029052c408d0701066231c
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x17875397ae87369365656d490e8ce956911bd97607f2aff41b56f6f3a61989826
+InvalidKeyY = 0x980a3c4f61b9692633fbba5ef04c9cb546dd05cdec9fa8428b8849670e2fba92
+
+# Point not on curve
+InvalidKeyX = 0xf2d1c0dc0852c3d8a2a2500a23a44813ccce1ac4e58444175b440469ffc12273
+InvalidKeyY = 0x32bfe992831b305d8c37b9672df5d29fcb5c29b4a40534683e3ace23d24647dd
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x10b0ca230fff7c04768f4b3d5c75fa9f6c539bea644dffbec5dc796a213061b58
+InvalidKeyY = 0x5edf37c11052b75f771b7f9fa050e353e464221fec916684ed45b6fead38205
+
+# Point not on curve
+InvalidKeyX = 0xa40d077a87dae157d93dcccf3fe3aca9c6479a75aa2669509d2ef05c7de6782f
+InvalidKeyY = 0x503d86b87d743ba20804fd7e7884aa017414a7b5b5963e0d46e3a9611419ddf3
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x14bf57f76c260b51ec6bbc72dbd49f02a56eaed070b774dc4bad75a54653c3d56
+InvalidKeyY = 0x7a231a23bf8b3aa31d9600d888a0678677a30e573decd3dc56b33f365cc11236
+
+# Point not on curve
+InvalidKeyX = 0xf8c6dd3181a76aa0e36c2790bba47041acbe7b1e473ff71eee39a824dc595ff0
+InvalidKeyY = 0x9c965f227f281b3072b95b8daf29e88b35284f3574462e268e529bbdc50e9e52
+
+# Point not on curve
+InvalidKeyX = 0x7a81a7e0b015252928d8b36e4ca37e92fdc328eb25c774b4f872693028c4be38
+InvalidKeyX = 0x08862f7335147261e7b1c3d055f9a316e4cab7daf99cc09d1c647f5dd6e7d5bb
+
+[P-384]
+
+Group = secp384r1
+
+# Point not on curve
+InvalidKeyX = 0xe87cc868cdf196471d3fc78c324be2c4a0de8dbde182afea88baa51666f3cc9993eae5f1d60d4aec58894f0357273c48
+InvalidKeyY = 0x187219b0adc398c835791798053cc6a0bcc6e43228ac23101ee93dfce0e508be988a55fa495eb93b832064dc035e7720
+
+# Point not on curve
+InvalidKeyX = 0x25e5509a54f5fa62f94551dff3dfe210db1bb2bbc8fd4e672fbd5a211f9fd2f7eadc2b83fcd4198b7f857d9a2dc39c11
+InvalidKeyY = 0x98a4a13bc2f2d04bebd6d4e04412a9d306e57b90364583a6ec25bf6f0175bb5b397b8cfea83fd5d1e0ad052852b4aba7
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x11a14be72dd023667047c260dd1960dd16555289d9570001d53ea3e494c1c107800dc5b24dd4de8490a071658702a0962
+InvalidKeyY = 0x78d65f6975d10df838b96a16cba873b59c28f2c7d05654b8c8b78bd193694ae45d6c6e046a20b984c3467c72d49395fe
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x1bf2238026a2489fb6ac1a8d6b82fdb33b05e8d01f1e2671eb22e61734031cc63efbf7e14d23e81fd432fc9935c627cdd
+InvalidKeyY = 0x6b377c8b187d568b782a28b38a7861b69e3d016f9f9ebb7eff2e7732a5132785b5a32e069dcef12875a995908a8b72f1
+
+# Point not on curve
+InvalidKeyX = 0xa999b80932ea62b4689769225b3ff34b0709c4e32342a824799ca63dcce1f3ed8819e080fc7fa130c1881c8131f4bcb5
+InvalidKeyY = 0xb8c77d0868c2c159e1be6bcd60ec488ab31531c21e1cb8fe2493ed26ac848fde7d27823a9a4912650511a3d460e25ef2
+
+# Point not on curve
+InvalidKeyX = 0x5cbaa8088b0804fe14c2a6fa54b1adee1690fd17a682ea9ec5202ba7575e217c37e98565b7e95e7c882bb6eef76a3df1
+InvalidKeyY = 0x79d8c7e96ae7a7668496317c596b24ebe56e6ea5bc64b74c38867eb2c419d8277d20b9c27a2d5c75d1c7a47885d38d0e
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0xcfb4dbdcb1a8c6e8c6b4a9dd091eed015476ebd20837de1f6261a27999a08cff345f0d4627eb7778fc3495916a6d017b
+InvalidKeyY = 0x1c08f7a421bc0731321374f9b31ecf5ca820c006180da4c496f29f0d0e4947f368808fd3052ee4f1afb8c2005fd0c0ee8
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x1adaff25f37c8dfd33ecf216691a2107e522c21c99e29a76d8c1757ef84cc37c73ec5c2aa3be2fb0d5f1d372e08fbf9e
+InvalidKeyY = 0x1f39c8f86a20c130c34f767e085217232599541516e2d79d8e526fa03082bed2a5dc5fde6fd410c30245212e7816dd014
+
+# [P-521]
+
+Group = secp521r1
+
+# Point not on curve
+InvalidKeyX = 0x165252970b786685babd0463f7314275c44ac1b558ab5a8e4bde60a441623b204982dcba2d3c0e7d379d5b637fd3edc0b0d2e0b7a33f7b36c03bb8bf3c6c5469ebe
+InvalidKeyY = 0x1300db0f0bc9b21ecff15eff4ed3bbe3dc1ac403dc96c89344d0030304da7ce57f1dc757af6816279464c61a0ab33645c3cd6583842cff0928081660b30775f594f
+
+# Point not on curve
+InvalidKeyX = 0x1a39c4c5d5f6af8285931694b030f6b8bbc0a012ab73c3947c72a6210643cc63673947f5847f2503bb81ae1c8b6a0d7cb0ee5675f9027ca75445aee2b6d7beb78ea
+InvalidKeyY = 0x148beebbe6e298779e59d8fc88cfc28f4aa784d927e5127813894b6d593760608539d2eb9db9cc8b39813a5e5e03a7d39be67c9c8a566fa8d65ff25b5bee83b0a9b
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x0bec1326722dd943f750fda964cb485f31469095e5b4b5c4fa02041e2f443693ac36c09f371aea7d501881fc4e369f68e071bb14c5003b31dce504bd14338eb8104
+InvalidKeyY = 0x36cd502b0a4e91e1080a5b94886a819a823687693ce878408b59183730c69e5ab2d6e05ea5f3d32855cf8c7c20da59a28913025a1fa6835a3751ec6da69502f0547
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x3e064e446ce29891240b02948288bedc37a4e4163a78702f942728e2d530cfecdc0362cf2209a706a9d4db24c1dd6aba7ad81d6ddecdf6e12073a1c31e2dacd185d
+InvalidKeyY = 0x12d0363dbdc4d157afd517beaecf2e6c93896a288c7cec5f9ba9394524fb6d4f647a9937fe440fda73f2e31410517ed5a814eed038356699085f9983f2ea5faccd0
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x164ce2e2fa873f5648c22ed37f26c13d3da3180a0f6c3aa4b68d0a13293784a5f1356fc2495217065de4f3b504ee2248747ef96180e102879363fa5393fe6fc5fbe
+InvalidKeyY = 0x23126d6903cbd7735291d77599cfe7f5e45056250c37deba2642dc0b7163ce0cf763d0d353bb9974cf15195c4bc4421bdae274492cfca739a8b8341235cc2268bc0
+
+# Point not on curve
+InvalidKeyX = 0x0dc2c4a23433293a771300ec79a3cd0f2e627110a97da85a82f4f85e7be9c280213048a3ad01b3e72bf54555a1b5da9945adcfed94ed8f6ed405c77506b5e00f45a
+InvalidKeyY = 0x18f746aacd6ed4eaaf9b038789927a30125691bc525b29592abb13cf98f64c03cb36a477dc53971563ee74f3a7614677ab6817f6e5f22ceb02c90826a33fe7c94cd
+
+# Point not on curve
+InvalidKeyX = 0x16e0383adc2986d01c18d7bde3b89eb5f732b56a6424c9394ec556a4660c3b88ddbc8654345ba6cff94bb002d16bc92e5907035f933785f633698e711738160d842
+InvalidKeyY = 0x1cf24be44e919e1576ecf51abdea113f8bb7121d670b86d8ee93ce1e6f79b17a6394987d74e6787facef5ca655196603468afd76e5cdf54ebb1331ce183cfe28c9e
+
+# InvalidKeyX or InvalidKeyY out of range
+InvalidKeyX = 0x3d68ed9ce2bcb68f12ac37385ccdb6ee445f7b0a8f257593735abdf8bc0b98bc5ab5c5750e2e111fec2ecde6be321522ddc90d2b54634d30d28f43024f76e4653a7
+InvalidKeyY = 0x03f6f5f224d6aee43d781e3ad723062a61729a6ed959cd18c75d4982961ba8033767ed1168674a545b0a693d3587fbeaebc9b116143dbe1155ead48de89d980d617
+
+
# TODO Google Wycheproof has some tests, too \ No newline at end of file
diff --git a/src/tests/test_ecdsa.cpp b/src/tests/test_ecdsa.cpp
index 2cd6b3aae..41d81a576 100644
--- a/src/tests/test_ecdsa.cpp
+++ b/src/tests/test_ecdsa.cpp
@@ -1,5 +1,6 @@
/*
* (C) 2014,2015 Jack Lloyd
+* (C) 2017 René Korthaus, Rohde & Schwarz Cybersecurity
*
* Botan is released under the Simplified BSD License (see license.txt)
*/