aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-09 00:47:58 +0000
committerlloyd <[email protected]>2010-03-09 00:47:58 +0000
commitc029a2dc6afa08ad70ae464ef80c81397e19bf20 (patch)
tree45e929a0002d9b49d75ec5378ab4e69c8fcea511
parent7833428ae736a0eec9a8af1b58837fca960159d3 (diff)
Use preexisting powermod precomputations for setting up blinders
-rw-r--r--src/pubkey/dh/dh.cpp2
-rw-r--r--src/pubkey/elgamal/elgamal.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/pubkey/dh/dh.cpp b/src/pubkey/dh/dh.cpp
index b242bf8c0..a99506250 100644
--- a/src/pubkey/dh/dh.cpp
+++ b/src/pubkey/dh/dh.cpp
@@ -79,7 +79,7 @@ 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);
- blinder = Blinder(k, power_mod(inverse_mod(k, p), dh.get_x(), p), 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
diff --git a/src/pubkey/elgamal/elgamal.cpp b/src/pubkey/elgamal/elgamal.cpp
index b2ffe36f3..f55aeaa4c 100644
--- a/src/pubkey/elgamal/elgamal.cpp
+++ b/src/pubkey/elgamal/elgamal.cpp
@@ -119,7 +119,7 @@ ElGamal_Decryption_Operation::ElGamal_Decryption_Operation(const ElGamal_Private
mod_p = Modular_Reducer(p);
BigInt k = Blinder::choose_nonce(key.get_x(), p);
- blinder = Blinder(k, power_mod(k, key.get_x(), p), p);
+ blinder = Blinder(k, powermod_x_p(k), p);
}
SecureVector<byte>