aboutsummaryrefslogtreecommitdiffstats
path: root/checks/pk_bench.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-02 05:08:15 +0000
committerlloyd <[email protected]>2010-03-02 05:08:15 +0000
commit3c15bd259f0921f1fa08ec91ee3cf2621c64a02d (patch)
tree54351d5e865a872896c6a95175693cc0ffa9e246 /checks/pk_bench.cpp
parent5fec937bd0c72858d6cf2f09b58b219294c7d5cc (diff)
parent54a3c5ae67f8b987d05ffd18e2d49a2da1d5988e (diff)
propagate from branch 'net.randombit.botan' (head fc86fc4842254088bf820ea6ebf05877aa63fb22)
to branch 'net.randombit.botan.c++0x' (head 77565ff7252df7f8faad86d65075498b0adb93d8)
Diffstat (limited to 'checks/pk_bench.cpp')
-rw-r--r--checks/pk_bench.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp
index 4a70a5899..84eba79e2 100644
--- a/checks/pk_bench.cpp
+++ b/checks/pk_bench.cpp
@@ -45,8 +45,8 @@
#include <botan/ecdsa.h>
#endif
-#if defined(BOTAN_HAS_ECKAEG)
- #include <botan/eckaeg.h>
+#if defined(BOTAN_HAS_ECDH)
+ #include <botan/ecdh.h>
#endif
using namespace Botan;
@@ -296,7 +296,8 @@ void benchmark_ecdsa(RandomNumberGenerator& rng,
for(size_t j = 0; domains[j]; j++)
{
- EC_Domain_Params params = get_EC_Dom_Pars_by_oid(domains[j]);
+ OID oid(domains[j]);
+ EC_Domain_Params params(oid);
u32bit pbits = params.get_curve().get_p().bits();
@@ -337,7 +338,7 @@ void benchmark_ecdsa(RandomNumberGenerator& rng,
#endif
-#if defined(BOTAN_HAS_ECKAEG)
+#if defined(BOTAN_HAS_ECDH)
void benchmark_eckaeg(RandomNumberGenerator& rng,
double seconds,
@@ -353,7 +354,8 @@ void benchmark_eckaeg(RandomNumberGenerator& rng,
for(size_t j = 0; domains[j]; j++)
{
- EC_Domain_Params params = get_EC_Dom_Pars_by_oid(domains[j]);
+ OID oid(domains[j]);
+ EC_Domain_Params params(oid);
u32bit pbits = params.get_curve().get_p().bits();
@@ -363,15 +365,15 @@ void benchmark_eckaeg(RandomNumberGenerator& rng,
while(kex_timer.seconds() < seconds)
{
keygen_timer.start();
- ECKAEG_PrivateKey eckaeg1(rng, params);
+ ECDH_PrivateKey eckaeg1(rng, params);
keygen_timer.stop();
keygen_timer.start();
- ECKAEG_PrivateKey eckaeg2(rng, params);
+ ECDH_PrivateKey eckaeg2(rng, params);
keygen_timer.stop();
- ECKAEG_PublicKey pub1(eckaeg1);
- ECKAEG_PublicKey pub2(eckaeg2);
+ ECDH_PublicKey pub1(eckaeg1);
+ ECDH_PublicKey pub2(eckaeg2);
SecureVector<byte> secret1, secret2;
@@ -389,11 +391,11 @@ void benchmark_eckaeg(RandomNumberGenerator& rng,
kex_timer.stop();
if(secret1 != secret2)
- std::cerr << "ECKAEG secrets did not match, bug in the library!?!\n";
+ std::cerr << "ECDH secrets did not match, bug in the library!?!\n";
}
}
- const std::string nm = "ECKAEG-" + std::to_string(pbits);
+ const std::string nm = "ECDH-" + std::to_string(pbits);
report.report(nm, keygen_timer);
report.report(nm, kex_timer);
}
@@ -670,8 +672,8 @@ void bench_pk(RandomNumberGenerator& rng,
benchmark_ecdsa(rng, seconds, report);
#endif
-#if defined(BOTAN_HAS_ECKAEG)
- if(algo == "All" || algo == "ECKAEG")
+#if defined(BOTAN_HAS_ECDH)
+ if(algo == "All" || algo == "ECDH")
benchmark_eckaeg(rng, seconds, report);
#endif