3 --- src
/math
/gfpmath
/curve_gfp
.cpp
.orig
2013-04-30 23:08:27.000000000 +0000
4 +++ src
/math
/gfpmath
/curve_gfp
.cpp
9 -void CurveGFp::set_shrd_mod(const std::tr1::shared_ptr
<GFpModulus
> mod
)
10 +void CurveGFp::set_shrd_mod(const shared_ptr
<GFpModulus
> mod
)
13 mA
.turn_off_sp_red_mul();// m.m. is not needed, must be trf. back
14 @@
-34,7 +34,7 @@
CurveGFp::CurveGFp(const GFpElement
& a
,
16 throw Invalid_Argument("could not construct curve: moduli of arguments differ");
18 - std::tr1::shared_ptr
<GFpModulus
> p_mod
= std::tr1::shared_ptr
<GFpModulus
>(new GFpModulus(p
));
19 + shared_ptr
<GFpModulus
> p_mod
= shared_ptr
<GFpModulus
>(new GFpModulus(p
));
20 // the above is the creation of the GFpModuls object which will be shared point-wide
21 // (in the context of a point of course)
23 @@
-44,21 +44,21 @@
CurveGFp::CurveGFp(const CurveGFp
& other
27 - mp_mod
= std::tr1::shared_ptr
<GFpModulus
>(new GFpModulus(*other
.mp_mod
));
28 + mp_mod
= shared_ptr
<GFpModulus
>(new GFpModulus(*other
.mp_mod
));
29 assert(mp_mod
->p_equal_to(mA
.get_p()));
30 assert(mp_mod
->p_equal_to(mB
.get_p()));
32 if(other
.mp_mres_a
.get())
34 - mp_mres_a
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_a
));
35 + mp_mres_a
= shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_a
));
37 if(other
.mp_mres_b
.get())
39 - mp_mres_b
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_b
));
40 + mp_mres_b
= shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_b
));
42 if(other
.mp_mres_one
.get())
44 - mp_mres_one
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_one
));
45 + mp_mres_one
= shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_one
));
49 @@
-72,21 +72,21 @@
const CurveGFp
& CurveGFp::operator=(cons
53 - std::tr1::shared_ptr
<GFpModulus
> p_mod
= std::tr1::shared_ptr
<GFpModulus
>(new GFpModulus(*other
.mp_mod
));
54 + shared_ptr
<GFpModulus
> p_mod
= shared_ptr
<GFpModulus
>(new GFpModulus(*other
.mp_mod
));
57 // exception safety note: no problem if we have a throw from here on...
58 if(other
.mp_mres_a
.get())
60 - mp_mres_a
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_a
));
61 + mp_mres_a
= shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_a
));
63 if(other
.mp_mres_b
.get())
65 - mp_mres_b
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_b
));
66 + mp_mres_b
= shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_b
));
68 if(other
.mp_mres_one
.get())
70 - mp_mres_one
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_one
));
71 + mp_mres_one
= shared_ptr
<GFpElement
>(new GFpElement(*other
.mp_mres_one
));
75 @@
-123,7 +123,7 @@ GFpElement
const CurveGFp::get_mres_a()
77 if(mp_mres_a
.get() == 0)
79 - mp_mres_a
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(mA
));
80 + mp_mres_a
= shared_ptr
<GFpElement
>(new GFpElement(mA
));
81 mp_mres_a
->turn_on_sp_red_mul();
82 mp_mres_a
->get_mres();
84 @@
-134,18 +134,18 @@ GFpElement
const CurveGFp::get_mres_b()
86 if(mp_mres_b
.get() == 0)
88 - mp_mres_b
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(mB
));
89 + mp_mres_b
= shared_ptr
<GFpElement
>(new GFpElement(mB
));
90 mp_mres_b
->turn_on_sp_red_mul();
91 mp_mres_b
->get_mres();
93 return GFpElement(*mp_mres_b
);
96 -std::tr1::shared_ptr
<GFpElement
const> const CurveGFp::get_mres_one() const
97 +shared_ptr
<GFpElement
const> const CurveGFp::get_mres_one() const
99 if(mp_mres_one
.get() == 0)
101 - mp_mres_one
= std::tr1::shared_ptr
<GFpElement
>(new GFpElement(mp_mod
->get_p(), 1));
102 + mp_mres_one
= shared_ptr
<GFpElement
>(new GFpElement(mp_mod
->get_p(), 1));
103 mp_mres_one
->turn_on_sp_red_mul();
104 mp_mres_one
->get_mres();