aboutsummaryrefslogtreecommitdiffstats
path: root/checks
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-02-24 15:46:01 +0000
committerlloyd <[email protected]>2010-02-24 15:46:01 +0000
commitb06a941a98f49172b203914810483589cf86cc76 (patch)
tree60185833656de660a4d31556b98d0170b56a1e5b /checks
parent83a0887fb47633522be1512a9b85a22769eba564 (diff)
Remove PointGFp::mult_this_secure
Diffstat (limited to 'checks')
-rw-r--r--checks/ec_tests.cpp27
-rw-r--r--checks/gfpmath.cpp49
2 files changed, 2 insertions, 74 deletions
diff --git a/checks/ec_tests.cpp b/checks/ec_tests.cpp
index 871425d20..cf63cc529 100644
--- a/checks/ec_tests.cpp
+++ b/checks/ec_tests.cpp
@@ -1032,26 +1032,6 @@ void test_point_swap(RandomNumberGenerator& rng)
* This test verifies that the side channel attack resistant multiplication function
* yields the same result as the normal (insecure) multiplication via operator*=
*/
-void test_mult_sec()
- {
- std::cout << "." << std::flush;
-
- EC_Domain_Params dom_pars(get_EC_Dom_Pars_by_oid("1.3.132.0.8"));
- PointGFp a(dom_pars.get_base_point());
- BigInt scal("123413545342234");
- PointGFp b = a * scal;
- PointGFp c(a);
- c.mult_this_secure(scal, dom_pars.get_order(), dom_pars.get_order()-1);
- PointGFp d(a);
- d.mult_this_secure(scal, BigInt(0), dom_pars.get_order()-1);
- CHECK(b == c);
- CHECK(c == d);
- }
-
-/**
-* This test verifies that the side channel attack resistant multiplication function
-* yields the same result as the normal (insecure) multiplication via operator*=
-*/
void test_mult_sec_mass(RandomNumberGenerator& rng)
{
@@ -1064,11 +1044,9 @@ void test_mult_sec_mass(RandomNumberGenerator& rng)
BigInt scal(BigInt(rng, 40));
PointGFp b = a * scal;
PointGFp c(a);
- c.mult_this_secure(scal, dom_pars.get_order()*dom_pars.get_cofactor(), dom_pars.get_order()-1);
- //PointGFp d(a);
- //d.mult_this_secure(scal, BigInt(0), dom_pars.get_order()-1);
+
+ c *= scal;
CHECK(b == c);
- //CHECK(c == d);
}
}
@@ -1192,7 +1170,6 @@ void do_ec_tests(RandomNumberGenerator& rng)
test_gfp_curve_precomp_mres();
//test_point_worksp();
test_point_swap(rng);
- test_mult_sec();
test_mult_sec_mass(rng);
test_curve_cp_ctor();
test_ec_key_cp_and_assignment(rng);
diff --git a/checks/gfpmath.cpp b/checks/gfpmath.cpp
index 57c40bffb..439b9be9b 100644
--- a/checks/gfpmath.cpp
+++ b/checks/gfpmath.cpp
@@ -563,55 +563,6 @@ bool test_bi_bit_access()
return pass;
}
-#if 0
-bool test_sec_mod_mul()
- {
- //cout << "starting test_sec_mod_mul" << endl;
-
- bool pass = true;
-
- //mod_mul_secure(BigInt const& a, BigInt const& b, BigInt const& m)
-
- BigInt m("5334243285367");
- BigInt a("3333333333333");
- BigInt b("4444444444444");
- for(int i = 0; i<10; i++)
- {
- std::cout << '.' << std::flush;
- BigInt c1 = a * b;
- c1 %= m;
- BigInt c2 = mod_mul_secure(a, b, m);
- CHECK_MESSAGE(c1 == c2, "should be " << c1 << ", was " << c2);
- }
- //cout << "ending test_sec_mod_mul" << endl;
- return pass;
- }
-#endif
-
-#if 0
-bool test_sec_bi_mul()
- {
- //mod_mul_secure(BigInt const& a, BigInt const& b, BigInt const& m)
-
- bool pass = true;
-
- BigInt m("5334243285367");
- BigInt a("3333333333333");
- BigInt b("4444444444444");
- for(int i = 0; i<10; i++)
- {
- std::cout << '.' << std::flush;
- BigInt c1 = a * b;
- //c1 %= m;
- BigInt c2(a);
- c2.mult_this_secure(b, m);
- CHECK_MESSAGE(c1 == c2, "should be " << c1 << ", was " << c2);
- }
-
- return pass;
- }
-#endif
-
}
u32bit do_gfpmath_tests(Botan::RandomNumberGenerator& rng)