From e125950d50406f9b2cbc0815777b5d3e9875e6c8 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 7 Jun 2017 16:17:21 -0400 Subject: Update speed --- src/cli/speed.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/cli') 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 #endif +#if defined(BOTAN_HAS_ED25519) + #include +#endif + #if defined(BOTAN_HAS_DIFFIE_HELLMAN) #include #endif @@ -403,6 +407,7 @@ std::vector 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 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) -- cgit v1.2.3