summaryrefslogtreecommitdiff
path: root/gfpcrypt.h
diff options
context:
space:
mode:
authorLinmao Song <linmao.song@ixledger.com>2018-01-11 01:18:15 +0000
committerJeffrey Walton <noloader@gmail.com>2018-01-10 20:18:15 -0500
commit1823b9d9c4076c09de038987ea2b6f851ef514d6 (patch)
tree1b48b3fbd14f5cd9054bee2a0e229a71ba054938 /gfpcrypt.h
parent2c295b2454c6ebb6e389a58e0cfae471479afe07 (diff)
downloadcryptopp-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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gfpcrypt.h b/gfpcrypt.h
index 81689f89..1f28a864 100644
--- a/gfpcrypt.h
+++ b/gfpcrypt.h
@@ -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());
}