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/cert/cvc/cvc_req.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cert/cvc/cvc_req.cpp') diff --git a/src/cert/cvc/cvc_req.cpp b/src/cert/cvc/cvc_req.cpp index a9a94827c..c2318dc1b 100644 --- a/src/cert/cvc/cvc_req.cpp +++ b/src/cert/cvc/cvc_req.cpp @@ -44,7 +44,7 @@ void EAC1_1_Req::force_decode() // XXX: No EAC support in ECDSA #if 0 ECDSA_PublicKey tmp_pk; - std::auto_ptr dec = tmp_pk.cvc_eac1_1_decoder(); + std::unique_ptr dec = tmp_pk.cvc_eac1_1_decoder(); sig_algo = dec->public_key(enc_pk); m_pk = tmp_pk; #endif -- cgit v1.2.3 From 3afb86663583b982e1eab8f46d07fc3d51260602 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 1 Apr 2009 16:42:38 +0000 Subject: Use C++0x std::shared_ptr<> instead of TR1's --- checks/ec_tests.cpp | 6 +++--- checks/gfpmath.cpp | 14 +++++++------- src/cert/cvc/cvc_ado.cpp | 6 +++--- src/cert/cvc/cvc_ado.h | 2 +- src/cert/cvc/cvc_ca.cpp | 2 +- src/cert/cvc/cvc_cert.cpp | 4 ++-- src/cert/cvc/cvc_cert.h | 2 +- src/cert/cvc/cvc_req.cpp | 4 ++-- src/cert/cvc/cvc_req.h | 2 +- src/cert/cvc/cvc_self.cpp | 4 ++-- src/cert/cvc/freestore.h | 11 ++--------- src/math/gfpmath/curve_gfp.cpp | 28 ++++++++++++++-------------- src/math/gfpmath/curve_gfp.h | 16 ++++++++-------- src/math/gfpmath/gfp_element.cpp | 6 +++--- src/math/gfpmath/gfp_element.h | 17 +++++------------ src/math/gfpmath/point_gfp.cpp | 16 ++++++++-------- src/math/gfpmath/point_gfp.h | 10 +++++----- 17 files changed, 68 insertions(+), 82 deletions(-) (limited to 'src/cert/cvc/cvc_req.cpp') diff --git a/checks/ec_tests.cpp b/checks/ec_tests.cpp index b079ebd47..5ee2002f3 100644 --- a/checks/ec_tests.cpp +++ b/checks/ec_tests.cpp @@ -80,8 +80,8 @@ void test_point_turn_on_sp_red_mul() CHECK_MESSAGE(r1 == r2, "error with point mul after extra turn on sp red mul"); CHECK(r1.get_affine_x().get_value() != BigInt("0")); - std::tr1::shared_ptr p_r1(new PointGFp(r1)); - std::tr1::shared_ptr p_r2(new PointGFp(r2)); + std::shared_ptr p_r1(new PointGFp(r1)); + std::shared_ptr p_r2(new PointGFp(r2)); p_r1->mult2_in_place(); // wird für Fehler nicht gebraucht p_r2->turn_on_sp_red_mul(); // 1. t_o() macht nur p_r2 kaputt @@ -981,7 +981,7 @@ void test_point_worksp() { EC_Domain_Params dom_pars(get_EC_Dom_Pars_by_oid("1.3.132.0.8")); - std::tr1::shared_ptr > worksp1; + std::shared_ptr > worksp1; assert(worksp1.get() == 0); { PointGFp p = dom_pars.get_base_point(); diff --git a/checks/gfpmath.cpp b/checks/gfpmath.cpp index 2352bba7e..6d8e406e3 100644 --- a/checks/gfpmath.cpp +++ b/checks/gfpmath.cpp @@ -484,13 +484,13 @@ bool test_gfp_shared_vals() GFpElement a(p, BigInt("234090")); GFpElement shcpy_a(1,0); shcpy_a.share_assign(a); - std::tr1::shared_ptr ptr1 = a.get_ptr_mod(); - std::tr1::shared_ptr ptr2 = shcpy_a.get_ptr_mod(); + std::shared_ptr ptr1 = a.get_ptr_mod(); + std::shared_ptr ptr2 = shcpy_a.get_ptr_mod(); CHECK_MESSAGE(ptr1.get() == ptr2.get(), "shared pointers for moduli aren´t equal"); GFpElement b(1,0); b = a; // create a non shared copy - std::tr1::shared_ptr ptr_b_p = b.get_ptr_mod(); + std::shared_ptr ptr_b_p = b.get_ptr_mod(); CHECK_MESSAGE(ptr1.get() != ptr_b_p.get(), "non shared pointers for moduli are equal"); a.turn_on_sp_red_mul(); @@ -513,15 +513,15 @@ bool test_gfp_shared_vals() } swap(a,shcpy_a); - std::tr1::shared_ptr ptr3 = a.get_ptr_mod(); - std::tr1::shared_ptr ptr4 = shcpy_a.get_ptr_mod(); + std::shared_ptr ptr3 = a.get_ptr_mod(); + std::shared_ptr ptr4 = shcpy_a.get_ptr_mod(); CHECK_MESSAGE(ptr3.get() == ptr4.get(), "shared pointers for moduli aren´t equal after swap"); CHECK(ptr1.get() == ptr4.get()); CHECK(ptr2.get() == ptr3.get()); swap(a,b); - std::tr1::shared_ptr ptr_a = a.get_ptr_mod(); - std::tr1::shared_ptr ptr_b = shcpy_a.get_ptr_mod(); + std::shared_ptr ptr_a = a.get_ptr_mod(); + std::shared_ptr ptr_b = shcpy_a.get_ptr_mod(); CHECK(ptr_a.get() == ptr_b_p.get()); CHECK(ptr_b.get() == ptr3.get()); return pass; diff --git a/src/cert/cvc/cvc_ado.cpp b/src/cert/cvc/cvc_ado.cpp index 19d76fe7f..47c972c72 100644 --- a/src/cert/cvc/cvc_ado.cpp +++ b/src/cert/cvc/cvc_ado.cpp @@ -12,7 +12,7 @@ namespace Botan { -EAC1_1_ADO::EAC1_1_ADO(std::tr1::shared_ptr in) +EAC1_1_ADO::EAC1_1_ADO(std::shared_ptr in) { init(in); do_decode(); @@ -20,7 +20,7 @@ EAC1_1_ADO::EAC1_1_ADO(std::tr1::shared_ptr in) EAC1_1_ADO::EAC1_1_ADO(const std::string& in) { - std::tr1::shared_ptr stream(new DataSource_Stream(in, true)); + std::shared_ptr stream(new DataSource_Stream(in, true)); init(stream); do_decode(); } @@ -41,7 +41,7 @@ void EAC1_1_ADO::force_decode() .end_cons() .get_contents(); - std::tr1::shared_ptr req_source(new DataSource_Memory(req_bits)); + std::shared_ptr req_source(new DataSource_Memory(req_bits)); m_req = EAC1_1_Req(req_source); sig_algo = m_req.sig_algo; } diff --git a/src/cert/cvc/cvc_ado.h b/src/cert/cvc/cvc_ado.h index ef469cc09..dbb4a3f47 100644 --- a/src/cert/cvc/cvc_ado.h +++ b/src/cert/cvc/cvc_ado.h @@ -39,7 +39,7 @@ class BOTAN_DLL EAC1_1_ADO : public EAC1_1_obj * Construct a CVC ADO request from a data source * @param source the data source */ - EAC1_1_ADO(std::tr1::shared_ptr source); + EAC1_1_ADO(std::shared_ptr source); /** * Create a signed CVC ADO request from to be signed (TBS) data diff --git a/src/cert/cvc/cvc_ca.cpp b/src/cert/cvc/cvc_ca.cpp index 7b1c5fcba..20cea9104 100644 --- a/src/cert/cvc/cvc_ca.cpp +++ b/src/cert/cvc/cvc_ca.cpp @@ -38,7 +38,7 @@ EAC1_1_CVC EAC1_1_CVC_CA::make_cert(PK_Signer& signer, EAC1_1_CVC::build_cert_body(tbs), rng); - std::tr1::shared_ptr source(new DataSource_Memory(signed_cert)); + std::shared_ptr source(new DataSource_Memory(signed_cert)); return EAC1_1_CVC(source); } diff --git a/src/cert/cvc/cvc_cert.cpp b/src/cert/cvc/cvc_cert.cpp index 7964b8900..352178fd2 100644 --- a/src/cert/cvc/cvc_cert.cpp +++ b/src/cert/cvc/cvc_cert.cpp @@ -78,7 +78,7 @@ void EAC1_1_CVC::force_decode() /* * CVC Certificate Constructor */ -EAC1_1_CVC::EAC1_1_CVC(std::tr1::shared_ptr& in) +EAC1_1_CVC::EAC1_1_CVC(std::shared_ptr& in) { init(in); self_signed = false; @@ -87,7 +87,7 @@ EAC1_1_CVC::EAC1_1_CVC(std::tr1::shared_ptr& in) EAC1_1_CVC::EAC1_1_CVC(const std::string& in) { - std::tr1::shared_ptr stream(new DataSource_Stream(in, true)); + std::shared_ptr stream(new DataSource_Stream(in, true)); init(stream); self_signed = false; do_decode(); diff --git a/src/cert/cvc/cvc_cert.h b/src/cert/cvc/cvc_cert.h index 17671d332..0bc162c0c 100644 --- a/src/cert/cvc/cvc_cert.h +++ b/src/cert/cvc/cvc_cert.h @@ -59,7 +59,7 @@ class BOTAN_DLL EAC1_1_CVC : public EAC1_1_gen_CVC//Signed_Object * Construct a CVC from a data source * @param source the data source */ - EAC1_1_CVC(std::tr1::shared_ptr& source); + EAC1_1_CVC(std::shared_ptr& source); /** * Construct a CVC from a file diff --git a/src/cert/cvc/cvc_req.cpp b/src/cert/cvc/cvc_req.cpp index c2318dc1b..5b2a2c4d4 100644 --- a/src/cert/cvc/cvc_req.cpp +++ b/src/cert/cvc/cvc_req.cpp @@ -50,7 +50,7 @@ void EAC1_1_Req::force_decode() #endif } -EAC1_1_Req::EAC1_1_Req(std::tr1::shared_ptr in) +EAC1_1_Req::EAC1_1_Req(std::shared_ptr in) { init(in); self_signed = true; @@ -59,7 +59,7 @@ EAC1_1_Req::EAC1_1_Req(std::tr1::shared_ptr in) EAC1_1_Req::EAC1_1_Req(const std::string& in) { - std::tr1::shared_ptr stream(new DataSource_Stream(in, true)); + std::shared_ptr stream(new DataSource_Stream(in, true)); init(stream); self_signed = true; do_decode(); diff --git a/src/cert/cvc/cvc_req.h b/src/cert/cvc/cvc_req.h index 8599f539d..4999c332f 100644 --- a/src/cert/cvc/cvc_req.h +++ b/src/cert/cvc/cvc_req.h @@ -36,7 +36,7 @@ class BOTAN_DLL EAC1_1_Req : public EAC1_1_gen_CVC * Construct a CVC request from a data source. * @param source the data source */ - EAC1_1_Req(std::tr1::shared_ptr source); + EAC1_1_Req(std::shared_ptr source); /** * Construct a CVC request from a DER encoded CVC reqeust file. diff --git a/src/cert/cvc/cvc_self.cpp b/src/cert/cvc/cvc_self.cpp index c31741956..47c46ca1c 100644 --- a/src/cert/cvc/cvc_self.cpp +++ b/src/cert/cvc/cvc_self.cpp @@ -136,7 +136,7 @@ EAC1_1_Req create_cvc_req(Private_Key const& key, EAC1_1_gen_CVC::make_signed(*signer.get(), EAC1_1_gen_CVC::build_cert_body(tbs), rng); - std::tr1::shared_ptr source(new DataSource_Memory(signed_cert)); + std::shared_ptr source(new DataSource_Memory(signed_cert)); return EAC1_1_Req(source); } @@ -160,7 +160,7 @@ EAC1_1_ADO create_ado_req(Private_Key const& key, tbs_bits.append(DER_Encoder().encode(car).get_contents()); MemoryVector signed_cert = EAC1_1_ADO::make_signed(*signer.get(), tbs_bits, rng); - std::tr1::shared_ptr source(new DataSource_Memory(signed_cert)); + std::shared_ptr source(new DataSource_Memory(signed_cert)); return EAC1_1_ADO(source); } diff --git a/src/cert/cvc/freestore.h b/src/cert/cvc/freestore.h index f95afa802..a6f779c78 100644 --- a/src/cert/cvc/freestore.h +++ b/src/cert/cvc/freestore.h @@ -7,14 +7,7 @@ #define BOTAN_FREESTORE_H__ #include - -#if defined(BOTAN_USE_STD_TR1) - #include -#elif defined(BOTAN_USE_BOOST_TR1) - #include -#else - #error "Please choose a TR1 implementation in build.h" -#endif +#include namespace Botan { @@ -30,7 +23,7 @@ template class BOTAN_DLL SharedPtrConverter { public: - typedef std::tr1::shared_ptr SharedPtr; + typedef std::shared_ptr SharedPtr; /** * Construct a null pointer equivalent object. diff --git a/src/math/gfpmath/curve_gfp.cpp b/src/math/gfpmath/curve_gfp.cpp index 37555ea06..54799a076 100644 --- a/src/math/gfpmath/curve_gfp.cpp +++ b/src/math/gfpmath/curve_gfp.cpp @@ -13,7 +13,7 @@ namespace Botan { -void CurveGFp::set_shrd_mod(const std::tr1::shared_ptr mod) +void CurveGFp::set_shrd_mod(const std::shared_ptr mod) { mp_mod = mod; mA.turn_off_sp_red_mul();// m.m. is not needed, must be trf. back @@ -33,7 +33,7 @@ CurveGFp::CurveGFp(const GFpElement& a, const GFpElement& b, { throw Invalid_Argument("could not construct curve: moduli of arguments differ"); } - std::tr1::shared_ptr p_mod = std::tr1::shared_ptr(new GFpModulus(p)); + std::shared_ptr p_mod = std::shared_ptr(new GFpModulus(p)); // the above is the creation of the GFpModuls object which will be shared point-wide // (in the context of a point of course) set_shrd_mod(p_mod); @@ -43,21 +43,21 @@ CurveGFp::CurveGFp(const CurveGFp& other) : mA(other.get_a()), mB(other.get_b()) { - mp_mod = std::tr1::shared_ptr(new GFpModulus(*other.mp_mod)); + mp_mod = std::shared_ptr(new GFpModulus(*other.mp_mod)); assert(mp_mod->p_equal_to(mA.get_p())); assert(mp_mod->p_equal_to(mB.get_p())); set_shrd_mod(mp_mod); if(other.mp_mres_a.get()) { - mp_mres_a = std::tr1::shared_ptr(new GFpElement(*other.mp_mres_a)); + mp_mres_a = std::shared_ptr(new GFpElement(*other.mp_mres_a)); } if(other.mp_mres_b.get()) { - mp_mres_b = std::tr1::shared_ptr(new GFpElement(*other.mp_mres_b)); + mp_mres_b = std::shared_ptr(new GFpElement(*other.mp_mres_b)); } if(other.mp_mres_one.get()) { - mp_mres_one = std::tr1::shared_ptr(new GFpElement(*other.mp_mres_one)); + mp_mres_one = std::shared_ptr(new GFpElement(*other.mp_mres_one)); } } @@ -71,21 +71,21 @@ const CurveGFp& CurveGFp::operator=(const CurveGFp& other) mA.swap(a_tmp); mB.swap(b_tmp); - std::tr1::shared_ptr p_mod = std::tr1::shared_ptr(new GFpModulus(*other.mp_mod)); + std::shared_ptr p_mod = std::shared_ptr(new GFpModulus(*other.mp_mod)); set_shrd_mod(p_mod); // exception safety note: no problem if we have a throw from here on... if(other.mp_mres_a.get()) { - mp_mres_a = std::tr1::shared_ptr(new GFpElement(*other.mp_mres_a)); + mp_mres_a = std::shared_ptr(new GFpElement(*other.mp_mres_a)); } if(other.mp_mres_b.get()) { - mp_mres_b = std::tr1::shared_ptr(new GFpElement(*other.mp_mres_b)); + mp_mres_b = std::shared_ptr(new GFpElement(*other.mp_mres_b)); } if(other.mp_mres_one.get()) { - mp_mres_one = std::tr1::shared_ptr(new GFpElement(*other.mp_mres_one)); + mp_mres_one = std::shared_ptr(new GFpElement(*other.mp_mres_one)); } return *this; } @@ -122,7 +122,7 @@ GFpElement const CurveGFp::get_mres_a() const { if(mp_mres_a.get() == 0) { - mp_mres_a = std::tr1::shared_ptr(new GFpElement(mA)); + mp_mres_a = std::shared_ptr(new GFpElement(mA)); mp_mres_a->turn_on_sp_red_mul(); mp_mres_a->get_mres(); } @@ -133,18 +133,18 @@ GFpElement const CurveGFp::get_mres_b() const { if(mp_mres_b.get() == 0) { - mp_mres_b = std::tr1::shared_ptr(new GFpElement(mB)); + mp_mres_b = std::shared_ptr(new GFpElement(mB)); mp_mres_b->turn_on_sp_red_mul(); mp_mres_b->get_mres(); } return GFpElement(*mp_mres_b); } -std::tr1::shared_ptr const CurveGFp::get_mres_one() const +std::shared_ptr const CurveGFp::get_mres_one() const { if(mp_mres_one.get() == 0) { - mp_mres_one = std::tr1::shared_ptr(new GFpElement(mp_mod->get_p(), 1)); + mp_mres_one = std::shared_ptr(new GFpElement(mp_mod->get_p(), 1)); mp_mres_one->turn_on_sp_red_mul(); mp_mres_one->get_mres(); } diff --git a/src/math/gfpmath/curve_gfp.h b/src/math/gfpmath/curve_gfp.h index 90d64b45d..2c9201560 100644 --- a/src/math/gfpmath/curve_gfp.h +++ b/src/math/gfpmath/curve_gfp.h @@ -57,7 +57,7 @@ class BOTAN_DLL CurveGFp * @param mod a shared pointer to a GFpModulus object suitable for * *this. */ - void set_shrd_mod(const std::tr1::shared_ptr mod); + void set_shrd_mod(const std::shared_ptr mod); // getters @@ -99,14 +99,14 @@ class BOTAN_DLL CurveGFp * function. * @result the GFpElement 1, transformed to its m-residue */ - std::tr1::shared_ptr const get_mres_one() const; + std::shared_ptr const get_mres_one() const; /** * Get prime modulus of the field of the curve * @result prime modulus of the field of the curve */ BigInt const get_p() const; - /*inline std::tr1::shared_ptr const get_ptr_p() const + /*inline std::shared_ptr const get_ptr_p() const { return mp_p; }*/ @@ -119,7 +119,7 @@ class BOTAN_DLL CurveGFp * Do NOT spread pointers to a GFpModulus over different threads! * @result a shared pointer to a GFpModulus object */ - inline std::tr1::shared_ptr const get_ptr_mod() const + inline std::shared_ptr const get_ptr_mod() const { return mp_mod; } @@ -131,12 +131,12 @@ class BOTAN_DLL CurveGFp void swap(CurveGFp& other); private: - std::tr1::shared_ptr mp_mod; + std::shared_ptr mp_mod; GFpElement mA; GFpElement mB; - mutable std::tr1::shared_ptr mp_mres_a; - mutable std::tr1::shared_ptr mp_mres_b; - mutable std::tr1::shared_ptr mp_mres_one; + mutable std::shared_ptr mp_mres_a; + mutable std::shared_ptr mp_mres_b; + mutable std::shared_ptr mp_mres_one; }; // relational operators diff --git a/src/math/gfpmath/gfp_element.cpp b/src/math/gfpmath/gfp_element.cpp index 183d7d4ab..7d7b7f34d 100644 --- a/src/math/gfpmath/gfp_element.cpp +++ b/src/math/gfpmath/gfp_element.cpp @@ -173,13 +173,13 @@ GFpElement::GFpElement(const BigInt& p, const BigInt& value, bool use_montgm) m_is_trf(false) { assert(mp_mod.get() == 0); - mp_mod = std::tr1::shared_ptr(new GFpModulus(p)); + mp_mod = std::shared_ptr(new GFpModulus(p)); assert(mp_mod->m_p_dash == 0); if(m_use_montgm) ensure_montgm_precomp(); } -GFpElement::GFpElement(std::tr1::shared_ptr const mod, const BigInt& value, bool use_montgm) +GFpElement::GFpElement(std::shared_ptr const mod, const BigInt& value, bool use_montgm) : mp_mod(), m_value(value % mod->m_p), m_use_montgm(use_montgm), @@ -246,7 +246,7 @@ void GFpElement::ensure_montgm_precomp() const } -void GFpElement::set_shrd_mod(std::tr1::shared_ptr const p_mod) +void GFpElement::set_shrd_mod(std::shared_ptr const p_mod) { mp_mod = p_mod; } diff --git a/src/math/gfpmath/gfp_element.h b/src/math/gfpmath/gfp_element.h index 0a1b4910c..1ee0be0ba 100644 --- a/src/math/gfpmath/gfp_element.h +++ b/src/math/gfpmath/gfp_element.h @@ -15,14 +15,7 @@ #include #include #include - -#if defined(BOTAN_USE_STD_TR1) - #include -#elif defined(BOTAN_USE_BOOST_TR1) - #include -#else - #error "Please choose a TR1 implementation in build.h" -#endif +#include namespace Botan { @@ -40,7 +33,7 @@ struct Illegal_Transformation : public Exception class BOTAN_DLL GFpElement { private: - std::tr1::shared_ptr mp_mod; + std::shared_ptr mp_mod; mutable BigInt m_value; // ordinary residue or m-residue respectively mutable BigInt workspace; @@ -79,7 +72,7 @@ class BOTAN_DLL GFpElement * @param value the element value * @param use_montgm whether this object will use Montgomery multiplication */ - explicit GFpElement(std::tr1::shared_ptr const mod, + explicit GFpElement(std::shared_ptr const mod, const BigInt& value, bool use_mongm = false); /** @@ -190,7 +183,7 @@ class BOTAN_DLL GFpElement * the shared GFpModulus objects! * @result the shared pointer to the GFpModulus of *this */ - inline std::tr1::shared_ptr const get_ptr_mod() const + inline std::shared_ptr const get_ptr_mod() const { return mp_mod; } @@ -203,7 +196,7 @@ class BOTAN_DLL GFpElement * the shared GFpModulus objects! * @param mod a shared pointer to a GFpModulus that will be held in *this */ - void set_shrd_mod(std::tr1::shared_ptr const mod); + void set_shrd_mod(std::shared_ptr const mod); /** * Tells whether this GFpElement is currently transformed to it´ m-residue, diff --git a/src/math/gfpmath/point_gfp.cpp b/src/math/gfpmath/point_gfp.cpp index 9139c3ef9..c997ac525 100644 --- a/src/math/gfpmath/point_gfp.cpp +++ b/src/math/gfpmath/point_gfp.cpp @@ -109,7 +109,7 @@ const PointGFp& PointGFp::assign_within_same_curve(PointGFp const& other) return *this; } -void PointGFp::set_shrd_mod(std::tr1::shared_ptr p_mod) +void PointGFp::set_shrd_mod(std::shared_ptr p_mod) { mX.set_shrd_mod(p_mod); mY.set_shrd_mod(p_mod); @@ -133,7 +133,7 @@ void PointGFp::ensure_worksp() const } } - mp_worksp_gfp_el = std::tr1::shared_ptr >(new std::vector); + mp_worksp_gfp_el = std::shared_ptr >(new std::vector); mp_worksp_gfp_el->reserve(9); for (u32bit i=0; iturn_on_sp_red_mul(); - std::tr1::shared_ptr H(new PointGFp(this->mC)); - std::tr1::shared_ptr tmp; // used for AADA + std::shared_ptr H(new PointGFp(this->mC)); + std::shared_ptr tmp; // used for AADA PointGFp P(*this); BigInt m(scalar); @@ -477,15 +477,15 @@ PointGFp& PointGFp::operator*=(const BigInt& scalar) return *this; } -inline std::tr1::shared_ptr PointGFp::mult_loop(int l, +inline std::shared_ptr PointGFp::mult_loop(int l, const BigInt& m, - std::tr1::shared_ptr H, - std::tr1::shared_ptr tmp, + std::shared_ptr H, + std::shared_ptr tmp, const PointGFp& P) { //assert(l >= (int)m.bits()- 1); tmp = H; - std::tr1::shared_ptr to_add(new PointGFp(P)); // we just need some point + std::shared_ptr to_add(new PointGFp(P)); // we just need some point // so that we can use op= // inside the loop for (int i=l; i >=0; i--) diff --git a/src/math/gfpmath/point_gfp.h b/src/math/gfpmath/point_gfp.h index 771605efc..b001bbbad 100644 --- a/src/math/gfpmath/point_gfp.h +++ b/src/math/gfpmath/point_gfp.h @@ -234,7 +234,7 @@ class BOTAN_DLL PointGFp * @param mod a shared pointer to a GFpModulus that will * be held in the members *this */ - void set_shrd_mod(std::tr1::shared_ptr p_mod); + void set_shrd_mod(std::shared_ptr p_mod); static GFpElement decompress(bool yMod2, GFpElement const& x, const CurveGFp& curve); @@ -242,9 +242,9 @@ class BOTAN_DLL PointGFp static const u32bit GFPEL_WKSP_SIZE = 9; void ensure_worksp() const; - inline std::tr1::shared_ptr mult_loop(int l, const BigInt& m, - std::tr1::shared_ptr H, - std::tr1::shared_ptr tmp, + inline std::shared_ptr mult_loop(int l, const BigInt& m, + std::shared_ptr H, + std::shared_ptr tmp, const PointGFp& P); CurveGFp mC; @@ -257,7 +257,7 @@ class BOTAN_DLL PointGFp mutable bool mZpow2_set; mutable bool mZpow3_set; mutable bool mAZpow4_set; - mutable std::tr1::shared_ptr > mp_worksp_gfp_el; + mutable std::shared_ptr > mp_worksp_gfp_el; }; -- cgit v1.2.3