diff options
author | Linmao Song <linmao.song@ixledger.com> | 2018-01-11 01:18:15 +0000 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-01-10 20:18:15 -0500 |
commit | 1823b9d9c4076c09de038987ea2b6f851ef514d6 (patch) | |
tree | 1b48b3fbd14f5cd9054bee2a0e229a71ba054938 /gfpcrypt.h | |
parent | 2c295b2454c6ebb6e389a58e0cfae471479afe07 (diff) | |
download | cryptopp-git-1823b9d9c4076c09de038987ea2b6f851ef514d6.tar.gz |
Fix error in bits2octets: should use the base point's bit count, instead of the hash value's. Also add test case for GetRandom, with original data from RFC6979 (#560)
Diffstat (limited to 'gfpcrypt.h')
-rw-r--r-- | gfpcrypt.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -384,7 +384,7 @@ protected: // curve's order.
SecByteBlock bits2octets(const SecByteBlock& in, const Integer& q) const
{
- Integer b2 = bits2int(in, in.size()*8);
+ Integer b2 = bits2int(in, q.BitCount());
Integer b1 = b2 - q;
return int2octets(b1.IsNegative() ? b2 : b1, q.ByteCount());
}
|