aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-06-07 16:17:21 -0400
committerJack Lloyd <[email protected]>2017-06-07 16:18:27 -0400
commite125950d50406f9b2cbc0815777b5d3e9875e6c8 (patch)
tree843571b0446316efbc4d7fd62b9a8a905e5a3239
parenta8e784972b10d41bfd49aeb3650f4ee03d449f55 (diff)
Update speed
-rw-r--r--src/cli/speed.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index a494e2a77..296b4b07a 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -88,6 +88,10 @@
#include <botan/ecgdsa.h>
#endif
+#if defined(BOTAN_HAS_ED25519)
+ #include <botan/ed25519.h>
+#endif
+
#if defined(BOTAN_HAS_DIFFIE_HELLMAN)
#include <botan/dh.h>
#endif
@@ -403,6 +407,7 @@ std::vector<std::string> default_benchmark_list()
"ECDSA",
"ECKCDSA",
"ECGDSA",
+ "Ed25519",
"Curve25519",
"NEWHOPE",
"McEliece",
@@ -506,6 +511,12 @@ class Speed final : public Command
bench_ecgdsa(ecc_groups, provider, msec);
}
#endif
+#if defined(BOTAN_HAS_ED25519)
+ else if(algo == "Ed25519")
+ {
+ bench_ed25519(provider, msec);
+ }
+#endif
#if defined(BOTAN_HAS_DIFFIE_HELLMAN)
else if(algo == "DH")
{
@@ -1398,6 +1409,24 @@ class Speed final : public Command
}
#endif
+#if defined(BOTAN_HAS_ED25519)
+ void bench_ed25519(const std::string& provider,
+ std::chrono::milliseconds msec)
+ {
+ const std::string nm = "Ed25519";
+
+ Timer keygen_timer(nm, provider, "keygen");
+
+ std::unique_ptr<Botan::Private_Key> key(keygen_timer.run([&]
+ {
+ return new Botan::Ed25519_PrivateKey(rng());
+ }));
+
+ output() << Timer::result_string_ops(keygen_timer);
+ bench_pk_sig(*key, nm, provider, "Pure", msec);
+ }
+#endif
+
#if defined(BOTAN_HAS_DIFFIE_HELLMAN)
void bench_dh(const std::string& provider,
std::chrono::milliseconds msec)