diff options
author | lloyd <[email protected]> | 2009-10-13 16:05:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-10-13 16:05:37 +0000 |
commit | 6f68dc5485ebd41fdef837ab651a47a893d84408 (patch) | |
tree | 3cda82570052b7bed24df2754c2245479188488a /src/math/gfpmath/curve_gfp.cpp | |
parent | 9268a0455a07d31a66364aa5b7594bd75250b466 (diff) | |
parent | 1b0448fae6652a2da7f0de1fdcd2bbcda9836ca9 (diff) |
propagate from branch 'net.randombit.botan' (head 139d6957d20f0b1202e0eacc63cb011588faffde)
to branch 'net.randombit.botan.c++0x' (head c16676fa6c393bc3f46a044755ce525a013380a6)
Diffstat (limited to 'src/math/gfpmath/curve_gfp.cpp')
-rw-r--r-- | src/math/gfpmath/curve_gfp.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/math/gfpmath/curve_gfp.cpp b/src/math/gfpmath/curve_gfp.cpp index 9a3ffd482..d88146dd5 100644 --- a/src/math/gfpmath/curve_gfp.cpp +++ b/src/math/gfpmath/curve_gfp.cpp @@ -14,7 +14,7 @@ namespace Botan { -void CurveGFp::set_shrd_mod(const std::tr1::shared_ptr<GFpModulus> mod) +void CurveGFp::set_shrd_mod(const std::shared_ptr<GFpModulus> mod) { mp_mod = mod; mA.turn_off_sp_red_mul();// m.m. is not needed, must be trf. back @@ -34,7 +34,7 @@ CurveGFp::CurveGFp(const GFpElement& a, const GFpElement& b, { throw Invalid_Argument("could not construct curve: moduli of arguments differ"); } - std::tr1::shared_ptr<GFpModulus> p_mod = std::tr1::shared_ptr<GFpModulus>(new GFpModulus(p)); + std::shared_ptr<GFpModulus> p_mod = std::shared_ptr<GFpModulus>(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); @@ -44,21 +44,21 @@ CurveGFp::CurveGFp(const CurveGFp& other) : mA(other.get_a()), mB(other.get_b()) { - mp_mod = std::tr1::shared_ptr<GFpModulus>(new GFpModulus(*other.mp_mod)); + mp_mod = std::shared_ptr<GFpModulus>(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<GFpElement>(new GFpElement(*other.mp_mres_a)); + mp_mres_a = std::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_a)); } if(other.mp_mres_b.get()) { - mp_mres_b = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b)); + mp_mres_b = std::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b)); } if(other.mp_mres_one.get()) { - mp_mres_one = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one)); + mp_mres_one = std::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one)); } } @@ -72,21 +72,21 @@ const CurveGFp& CurveGFp::operator=(const CurveGFp& other) mA.swap(a_tmp); mB.swap(b_tmp); - std::tr1::shared_ptr<GFpModulus> p_mod = std::tr1::shared_ptr<GFpModulus>(new GFpModulus(*other.mp_mod)); + std::shared_ptr<GFpModulus> p_mod = std::shared_ptr<GFpModulus>(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<GFpElement>(new GFpElement(*other.mp_mres_a)); + mp_mres_a = std::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_a)); } if(other.mp_mres_b.get()) { - mp_mres_b = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b)); + mp_mres_b = std::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b)); } if(other.mp_mres_one.get()) { - mp_mres_one = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one)); + mp_mres_one = std::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one)); } return *this; } @@ -123,7 +123,7 @@ GFpElement const CurveGFp::get_mres_a() const { if(mp_mres_a.get() == 0) { - mp_mres_a = std::tr1::shared_ptr<GFpElement>(new GFpElement(mA)); + mp_mres_a = std::shared_ptr<GFpElement>(new GFpElement(mA)); mp_mres_a->turn_on_sp_red_mul(); mp_mres_a->get_mres(); } @@ -134,18 +134,18 @@ GFpElement const CurveGFp::get_mres_b() const { if(mp_mres_b.get() == 0) { - mp_mres_b = std::tr1::shared_ptr<GFpElement>(new GFpElement(mB)); + mp_mres_b = std::shared_ptr<GFpElement>(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<GFpElement const> const CurveGFp::get_mres_one() const +std::shared_ptr<GFpElement const> const CurveGFp::get_mres_one() const { if(mp_mres_one.get() == 0) { - mp_mres_one = std::tr1::shared_ptr<GFpElement>(new GFpElement(mp_mod->get_p(), 1)); + mp_mres_one = std::shared_ptr<GFpElement>(new GFpElement(mp_mod->get_p(), 1)); mp_mres_one->turn_on_sp_red_mul(); mp_mres_one->get_mres(); } |