diff options
author | lloyd <[email protected]> | 2011-05-17 19:57:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-05-17 19:57:34 +0000 |
commit | b0560e9a8fee0391146e3b4ad25434950aba80e2 (patch) | |
tree | c3d39cdae524a2414138764db274829b9c8607c7 /checks/ec_tests.cpp | |
parent | e6d4bee20f480b6bd0dd1c01fde491529dac10cc (diff) |
Modify ECC points to do all math in Montgomery form, rather than
converting back and forth. This gives a 10 to 20% speedup on a Core
i7. In addition, the CurveGFp no longer contains a Barrett reducer,
saving 3 BigInts worth of memory.
Add a #if'ed out alternative to point multiplication using the
Montgomery ladder technique. It runs in (more or less) constant time,
but rather significantly slower than the 4 bit window technique
currently used.
Tweak the window sizes to match the theoretical optimums.
Diffstat (limited to 'checks/ec_tests.cpp')
-rw-r--r-- | checks/ec_tests.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/checks/ec_tests.cpp b/checks/ec_tests.cpp index df17f672b..8ed975603 100644 --- a/checks/ec_tests.cpp +++ b/checks/ec_tests.cpp @@ -14,6 +14,7 @@ #include <botan/curve_gfp.h> #include <botan/point_gfp.h> #include <botan/ec_group.h> +#include <botan/reducer.h> #include <botan/oids.h> using namespace Botan; @@ -42,7 +43,7 @@ PointGFp create_random_point(RandomNumberGenerator& rng, { const BigInt& p = curve.get_p(); - const Modular_Reducer& mod_p = curve.mod_p(); + Modular_Reducer mod_p(p); while(true) { |