aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecdsa/ecdsa.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-01-21 16:36:12 +0000
committerlloyd <[email protected]>2010-01-21 16:36:12 +0000
commit412a13fc607a57bd9986155d247353ba8e5fb203 (patch)
treecbdf63aaa7e9f28a748dedda286e79a138573f74 /src/pubkey/ecdsa/ecdsa.cpp
parent41bed2fa0c4d96faf805cd33850166972dcac114 (diff)
parent9b82bb5a720f32e3e7878550310b1151cac188b8 (diff)
propagate from branch 'net.randombit.botan' (head 12382647ef0a28fcb11c824c77b670cc88a4f721)
to branch 'net.randombit.botan.c++0x' (head b586a3286d2c4d547ad3add5af9df1455bf4b87b)
Diffstat (limited to 'src/pubkey/ecdsa/ecdsa.cpp')
-rw-r--r--src/pubkey/ecdsa/ecdsa.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/pubkey/ecdsa/ecdsa.cpp b/src/pubkey/ecdsa/ecdsa.cpp
index 6116f7b13..dffd37e6f 100644
--- a/src/pubkey/ecdsa/ecdsa.cpp
+++ b/src/pubkey/ecdsa/ecdsa.cpp
@@ -19,7 +19,7 @@ namespace Botan {
ECDSA_PrivateKey::ECDSA_PrivateKey(RandomNumberGenerator& rng,
const EC_Domain_Params& dom_pars)
{
- mp_dom_pars = std::auto_ptr<EC_Domain_Params>(new EC_Domain_Params(dom_pars));
+ mp_dom_pars = std::unique_ptr<EC_Domain_Params>(new EC_Domain_Params(dom_pars));
generate_private_key(rng);
try
@@ -37,10 +37,10 @@ ECDSA_PrivateKey::ECDSA_PrivateKey(RandomNumberGenerator& rng,
ECDSA_PrivateKey::ECDSA_PrivateKey(const EC_Domain_Params& domain,
const BigInt& x)
{
- mp_dom_pars = std::auto_ptr<EC_Domain_Params>(new EC_Domain_Params(domain));
+ mp_dom_pars = std::unique_ptr<EC_Domain_Params>(new EC_Domain_Params(domain));
m_private_value = x;
- mp_public_point = std::auto_ptr<PointGFp>(new PointGFp (mp_dom_pars->get_base_point()));
+ mp_public_point = std::unique_ptr<PointGFp>(new PointGFp (mp_dom_pars->get_base_point()));
mp_public_point->mult_this_secure(m_private_value,
mp_dom_pars->get_order(),
mp_dom_pars->get_order()-1);
@@ -90,11 +90,10 @@ void ECDSA_PublicKey::set_domain_parameters(const EC_Domain_Params& dom_pars)
throw Invalid_State("EC_PublicKey::set_domain_parameters(): point does not lie on provided curve");
}
- std::auto_ptr<EC_Domain_Params> p_tmp_pars(new EC_Domain_Params(dom_pars));
- ECDSA_Core tmp_ecdsa_core(*p_tmp_pars, BigInt(0), tmp_pp);
+ mp_dom_pars.reset(new EC_Domain_Params(dom_pars));
+ ECDSA_Core tmp_ecdsa_core(*mp_dom_pars, BigInt(0), tmp_pp);
mp_public_point.reset(new PointGFp(tmp_pp));
m_ecdsa_core = tmp_ecdsa_core;
- mp_dom_pars = p_tmp_pars;
}
void ECDSA_PublicKey::set_all_values(const ECDSA_PublicKey& other)
@@ -134,8 +133,8 @@ bool ECDSA_PublicKey::verify(const byte msg[], u32bit msg_len,
ECDSA_PublicKey::ECDSA_PublicKey(const EC_Domain_Params& dom_par,
const PointGFp& public_point)
{
- mp_dom_pars = std::auto_ptr<EC_Domain_Params>(new EC_Domain_Params(dom_par));
- mp_public_point = std::auto_ptr<PointGFp>(new PointGFp(public_point));
+ mp_dom_pars = std::unique_ptr<EC_Domain_Params>(new EC_Domain_Params(dom_par));
+ mp_public_point = std::unique_ptr<PointGFp>(new PointGFp(public_point));
m_param_enc = ENC_EXPLICIT;
m_ecdsa_core = ECDSA_Core(*mp_dom_pars, BigInt(0), *mp_public_point);
}