diff options
author | Jack Lloyd <[email protected]> | 2018-03-21 12:11:12 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-21 12:11:12 -0400 |
commit | 3a9704c41a14d02a70d31be0e3288c591e547f08 (patch) | |
tree | 72c500534291f50d8ace84525a03331a1a3f0b24 /src/lib | |
parent | 574f44727d386984cf87a1161cec135209091650 (diff) |
Revamp GOST-34.10 tests
Use an official vector (from RFC 5832), support arbitrary curves
since GOST likes those for testing.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/pubkey/gost_3410/gost_3410.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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<uint8_t> 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); |