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/lib/pubkey/gost_3410/gost_3410.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/pubkey/gost_3410/gost_3410.cpp b/src/lib/pubkey/gost_3410/gost_3410.cpp index 4e2df4cb8..0fcca1b8d 100644 --- a/src/lib/pubkey/gost_3410/gost_3410.cpp +++ b/src/lib/pubkey/gost_3410/gost_3410.cpp @@ -119,12 +119,7 @@ secure_vector GOST_3410_Signature_Operation::raw_sign(const uint8_t msg[], size_t msg_len, RandomNumberGenerator& rng) { - BigInt k; - - do - { - k.randomize(rng, m_group.get_order_bits() - 1); - } while(k >= m_group.get_order()); + const BigInt k = m_group.random_scalar(rng); BigInt e = decode_le(msg, msg_len); -- cgit v1.2.3