aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecc_key/ecc_key.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/ecc_key/ecc_key.cpp')
-rw-r--r--src/pubkey/ecc_key/ecc_key.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp
index b7f58eecc..6ed1fd9c6 100644
--- a/src/pubkey/ecc_key/ecc_key.cpp
+++ b/src/pubkey/ecc_key/ecc_key.cpp
@@ -163,15 +163,11 @@ void EC_PrivateKey::generate_private_key(RandomNumberGenerator& rng)
throw Invalid_State("cannot generate private key when domain parameters are not set");
}
- BigInt tmp_private_value(0);
- tmp_private_value = BigInt::random_integer(rng, 1, mp_dom_pars->get_order());
+ m_private_value = BigInt::random_integer(rng, 1, mp_dom_pars->get_order());
+
mp_public_point = std::auto_ptr<PointGFp>( new PointGFp (mp_dom_pars->get_base_point()));
- mp_public_point->mult_this_secure(tmp_private_value,
- mp_dom_pars->get_order(),
- mp_dom_pars->get_order()-1);
- //assert(mp_public_point.get() != 0);
- tmp_private_value.swap(m_private_value);
+ *mp_public_point *= m_private_value;
}
/**