aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/dh/dh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/dh/dh.cpp')
-rw-r--r--src/pubkey/dh/dh.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pubkey/dh/dh.cpp b/src/pubkey/dh/dh.cpp
index a99506250..b491be7bc 100644
--- a/src/pubkey/dh/dh.cpp
+++ b/src/pubkey/dh/dh.cpp
@@ -78,11 +78,11 @@ MemoryVector<byte> DH_PrivateKey::public_value() const
DH_KA_Operation::DH_KA_Operation(const DH_PrivateKey& dh) :
p(dh.group_p()), powermod_x_p(dh.get_x(), p)
{
- BigInt k = Blinder::choose_nonce(dh.get_x(), p);
+ BigInt k = Blinder::choose_nonce(powermod_x_p(2), p);
blinder = Blinder(k, powermod_x_p(inverse_mod(k, p)), p);
}
-SecureVector<byte> DH_KA_Operation::agree(const byte w[], u32bit w_len) const
+SecureVector<byte> DH_KA_Operation::agree(const byte w[], u32bit w_len)
{
BigInt input = BigInt::decode(w, w_len);