aboutsummaryrefslogtreecommitdiffstats
path: root/checks
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-04-01 16:42:38 +0000
committerlloyd <[email protected]>2009-04-01 16:42:38 +0000
commit3afb86663583b982e1eab8f46d07fc3d51260602 (patch)
tree3cdf7950fb61f96d8d8b9d37dc71f68dba5f1bbc /checks
parent327115405b0f483c2b432e2233f355a349b1f9d7 (diff)
Use C++0x std::shared_ptr<> instead of TR1's
Diffstat (limited to 'checks')
-rw-r--r--checks/ec_tests.cpp6
-rw-r--r--checks/gfpmath.cpp14
2 files changed, 10 insertions, 10 deletions
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<PointGFp> p_r1(new PointGFp(r1));
- std::tr1::shared_ptr<PointGFp> p_r2(new PointGFp(r2));
+ std::shared_ptr<PointGFp> p_r1(new PointGFp(r1));
+ std::shared_ptr<PointGFp> 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<std::vector<GFpElement> > worksp1;
+ std::shared_ptr<std::vector<GFpElement> > 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<GFpModulus> ptr1 = a.get_ptr_mod();
- std::tr1::shared_ptr<GFpModulus> ptr2 = shcpy_a.get_ptr_mod();
+ std::shared_ptr<GFpModulus> ptr1 = a.get_ptr_mod();
+ std::shared_ptr<GFpModulus> 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<GFpModulus> ptr_b_p = b.get_ptr_mod();
+ std::shared_ptr<GFpModulus> 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<GFpModulus> ptr3 = a.get_ptr_mod();
- std::tr1::shared_ptr<GFpModulus> ptr4 = shcpy_a.get_ptr_mod();
+ std::shared_ptr<GFpModulus> ptr3 = a.get_ptr_mod();
+ std::shared_ptr<GFpModulus> 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<GFpModulus> ptr_a = a.get_ptr_mod();
- std::tr1::shared_ptr<GFpModulus> ptr_b = shcpy_a.get_ptr_mod();
+ std::shared_ptr<GFpModulus> ptr_a = a.get_ptr_mod();
+ std::shared_ptr<GFpModulus> ptr_b = shcpy_a.get_ptr_mod();
CHECK(ptr_a.get() == ptr_b_p.get());
CHECK(ptr_b.get() == ptr3.get());
return pass;