From 3a9704c41a14d02a70d31be0e3288c591e547f08 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 21 Mar 2018 12:11:12 -0400 Subject: Revamp GOST-34.10 tests Use an official vector (from RFC 5832), support arbitrary curves since GOST likes those for testing. --- src/tests/data/pubkey/gost_3410_sign.vec | 29 +++++++++++++++-------------- src/tests/data/pubkey/gost_3410_verify.vec | 28 +++++++++++++--------------- 2 files changed, 28 insertions(+), 29 deletions(-) (limited to 'src/tests/data/pubkey') diff --git a/src/tests/data/pubkey/gost_3410_sign.vec b/src/tests/data/pubkey/gost_3410_sign.vec index 25d5155b7..67599a7ec 100644 --- a/src/tests/data/pubkey/gost_3410_sign.vec +++ b/src/tests/data/pubkey/gost_3410_sign.vec @@ -1,17 +1,18 @@ -# These values were generated by Botan and have not been tested against any -# other implementation. +# Test from RFC 5283 + +P = 0x8000000000000000000000000000000000000000000000000000000000000431 +A = 0x7 +B = 0x5FBFF498AA938CE739B8E022FBAFEF40563F6E6A3472FC2A514C0CE9DAE23B7E +Order = 0x8000000000000000000000000000000150FE8A1892976154C59CFC193ACCF5B3 +Cofactor = 1 +Gx = 2 +Gy = 0x8E2A8A0E65147D4BD6316030E16D19C85C97F0A9CA267122B96ABBCEA7E8FC8 +X = 0x7A929ADE789BB9BE10ED359DD39A72C11B60961F49397EEE1D19CE9891EC3B28 + +Hash = Raw +Nonce = 77105C9B20BCD3122823C8CF6FCC7B956DE33814E95B7FE64FED924594DCEAB3 +Msg = E53E042B67E6EC678E2E02B12A0352CE1FC6EEE0529CC088119AD872B3C1FB2D +Signature = 01456C64BA4642A1653C235A98A60249BCD6D3F746B631DF928014F6C5BF9C4041AA28D2F1AB148280CD9ED56FEDA41974053554A42767B83AD043FD39DC0493 -Group = gost_256A -Privkey = 0xFE406F383A54127453AED406FA9A3B610B28F89FC918C07A5A75289E97B3A991 -Hash = GOST-34.11 -Msg = ABCD -Nonce = 3E0A6097034780CCF32885B870F84B0AA20138BE94A1AA1F77F8997CAC25C58E -Signature = 60053488E6936975A4913083FE16A0CF620FA75732B563AB65B82D37A825BE7D0965C38281A01D23FA5F5D332B339EB2602A564563C005335269A2E811520563 -Group = gost_256A -Privkey = 0xFDCE35FFFF3AEF1C3AB247F31D733490B4029E699FC2D1C24B2F7C526CBC1445 -Hash = GOST-34.11 -Msg = 33C466741BB472998A27E26E7F77EBF3 -Nonce = 6844F464FA0147FB7D798137680FBA6EA2E709814E3A8B70EFC26F446DE9F94B -Signature = 5E39519E12B5208B3A0A1A1CDD44E2629F0F76A51DFED8484A8B67A2E46D5B871AFADA58E26D1FE08AB4D2E67BF0FF8508870B417D6EA1224FA98B3165D8A032 diff --git a/src/tests/data/pubkey/gost_3410_verify.vec b/src/tests/data/pubkey/gost_3410_verify.vec index 5348467a6..65e2dcd2c 100644 --- a/src/tests/data/pubkey/gost_3410_verify.vec +++ b/src/tests/data/pubkey/gost_3410_verify.vec @@ -1,18 +1,16 @@ -Group = gost_256A -Pubkey = 0400B6F1D75EF48902B0C2302F52CCC71233EC55B903061673AAA586A2B5864048EA2675E8FD8DB1FEDFC7DD40E3CF3A319EE3130E0BE9FDF994B625BC1885F271 -Hash = GOST-34.11 -Msg = -Signature = FE406F383A54127453AED406FA9A3B610B28F89FC918C07A5A75289E97B3A991AA3CB0563295A3E281BA368DF8471DE0A4150B3CFCEA575D8A9CC9779035EC36 +# Test value derived from RFC 5832 -Group = gost_256A -Pubkey = 04BFE0BA366BE575E45C5BBA339C51ACD75D517008A9D3169E3CCEA6EF08046DA74312382D835BEEA1C561A75AFCAFDA0F75A4E5D9787F9DB2870A032AC1D90465 -Hash = GOST-34.11 -Msg = -Signature = F3AFCBE1398DDC01F0A9E4B45397F3ACD8F343399BD2805FB6293E9CB871123AB7AB61F33E0B70166C355963BB80B8F6DF54F7F6A43872295CD42B6ACF7DF678 +P = 0x8000000000000000000000000000000000000000000000000000000000000431 +A = 0x7 +B = 0x5FBFF498AA938CE739B8E022FBAFEF40563F6E6A3472FC2A514C0CE9DAE23B7E +Order = 0x8000000000000000000000000000000150FE8A1892976154C59CFC193ACCF5B3 +Cofactor = 1 +Gx = 2 +Gy = 0x8E2A8A0E65147D4BD6316030E16D19C85C97F0A9CA267122B96ABBCEA7E8FC8 +Px = 0x7F2B49E270DB6D90D8595BEC458B50C58585BA1D4E9B788F6689DBD8E56FD80B +Py = 0x26F1B489D6701DD185C8413A977B3CBBAF64D1C593D26627DFFB101A87FF77DA -Group = gost_256A -Pubkey = 03773DC3F032886D56439A9F17490B680570043F757252C1F60819D6C30DBF1469 -Hash = GOST-34.11 -Msg = 00010C0300000E1070DBD880386D4380E954076578616D706C65036E65740003777777076578616D706C65036E6574000001000100000E100004C0000201 -Signature = 66ED09C0A6C97E22CB4E66BCA61D2082FDF6924F3A717C43B531B2D43FEE76DBB0F490A7901B009CCDF87252EBE1790A9AB1A6A444DBACA3E264AF21D18B5E83 +Hash = Raw +Msg = E53E042B67E6EC678E2E02B12A0352CE1FC6EEE0529CC088119AD872B3C1FB2D +Signature = 01456C64BA4642A1653C235A98A60249BCD6D3F746B631DF928014F6C5BF9C4041AA28D2F1AB148280CD9ED56FEDA41974053554A42767B83AD043FD39DC0493 -- cgit v1.2.3