From 327115405b0f483c2b432e2233f355a349b1f9d7 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 1 Apr 2009 16:38:08 +0000 Subject: Replace the (deprecated) auto_ptr with unique_ptr. This was mostly a s/auto_ptr/unique_ptr/, except in the CVC code and one function in ECDSA, which relied on auto_ptr's move semantics (ugh) and had to be modified in various ways. --- src/pubkey/ecdsa/ecdsa.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/pubkey/ecdsa/ecdsa.cpp') diff --git a/src/pubkey/ecdsa/ecdsa.cpp b/src/pubkey/ecdsa/ecdsa.cpp index 9640c6397..3e3bbf38a 100644 --- a/src/pubkey/ecdsa/ecdsa.cpp +++ b/src/pubkey/ecdsa/ecdsa.cpp @@ -20,7 +20,7 @@ namespace Botan { ECDSA_PrivateKey::ECDSA_PrivateKey(RandomNumberGenerator& rng, const EC_Domain_Params& dom_pars) { - mp_dom_pars = std::auto_ptr(new EC_Domain_Params(dom_pars)); + mp_dom_pars = std::unique_ptr(new EC_Domain_Params(dom_pars)); generate_private_key(rng); try @@ -68,11 +68,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 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) @@ -131,8 +130,8 @@ bool ECDSA_PublicKey::verify(const byte message[], ECDSA_PublicKey::ECDSA_PublicKey(const EC_Domain_Params& dom_par, const PointGFp& public_point) { - mp_dom_pars = std::auto_ptr(new EC_Domain_Params(dom_par)); - mp_public_point = std::auto_ptr(new PointGFp(public_point)); + mp_dom_pars = std::unique_ptr(new EC_Domain_Params(dom_par)); + mp_public_point = std::unique_ptr(new PointGFp(public_point)); m_param_enc = ENC_EXPLICIT; m_ecdsa_core = ECDSA_Core(*mp_dom_pars, BigInt(0), *mp_public_point); } -- cgit v1.2.3