diff options
author | lloyd <[email protected]> | 2010-03-13 19:31:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-13 19:31:27 +0000 |
commit | 634f3d27f7faad1dc558821382f71ecc2194637d (patch) | |
tree | dd4e626a4ac3ff5c928460b9e133007023d3321c /checks | |
parent | 1fe724175fdad94d724d401c46b5187f5f539136 (diff) | |
parent | 72a154f3d7eef286b42a116232f8b7be88ccb6d6 (diff) |
propagate from branch 'net.randombit.botan' (head aabb4c3bc2207ceac1920573293b95d138a185df)
to branch 'net.randombit.botan.c++0x' (head 179172dd6952f15f832855f4ec0ac48cb1e08188)
Diffstat (limited to 'checks')
-rw-r--r-- | checks/pk_bench.cpp | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp index 6893917fd..513a84f76 100644 --- a/checks/pk_bench.cpp +++ b/checks/pk_bench.cpp @@ -7,6 +7,7 @@ #include <botan/pkcs8.h> #include <botan/mem_ops.h> #include <botan/parsing.h> +#include <botan/oids.h> #include <map> #if defined(BOTAN_HAS_RSA) @@ -66,6 +67,16 @@ using namespace Botan; namespace { +const char* ec_domains[] = { + "secp160r2", + "secp192r1", + "secp224r1", + "secp256r1", + "secp384r1", + "secp521r1", + 0 +}; + class Benchmark_Report { public: @@ -293,20 +304,9 @@ void benchmark_ecdsa(RandomNumberGenerator& rng, double seconds, Benchmark_Report& report) { - const char* domains[] = { "1.3.132.0.6", // secp112r1 - "1.3.132.0.28", // secp128r1 - "1.3.132.0.30", // secp160r2 - "1.2.840.10045.3.1.1", // secp192r1 - "1.3.132.0.33", // secp224r1 - "1.2.840.10045.3.1.7", // secp256r1 - "1.3.132.0.34", // secp384r1 - "1.3.132.0.35", // secp512r1 - NULL }; - - for(size_t j = 0; domains[j]; j++) + for(size_t j = 0; ec_domains[j]; j++) { - OID oid(domains[j]); - EC_Domain_Params params(oid); + EC_Domain_Params params(OIDS::lookup(ec_domains[j])); u32bit pbits = params.get_curve().get_p().bits(); @@ -353,19 +353,9 @@ void benchmark_gost_3410(RandomNumberGenerator& rng, double seconds, Benchmark_Report& report) { - const char* domains[] = { "1.3.132.0.6", // secp112r1 - "1.3.132.0.28", // secp128r1 - "1.3.132.0.30", // secp160r2 - "1.3.132.0.33", // secp224r1 - "1.2.643.2.2.35.1", // gost 256p - "1.3.132.0.34", // secp384r1 - "1.3.132.0.35", // secp512r1 - NULL }; - - for(size_t j = 0; domains[j]; j++) + for(size_t j = 0; ec_domains[j]; j++) { - OID oid(domains[j]); - EC_Domain_Params params(oid); + EC_Domain_Params params(OIDS::lookup(ec_domains[j])); u32bit pbits = params.get_curve().get_p().bits(); @@ -412,18 +402,9 @@ void benchmark_ecdh(RandomNumberGenerator& rng, double seconds, Benchmark_Report& report) { - const char* domains[] = { "1.3.132.0.6", // secp112r1 - "1.3.132.0.28", // secp128r1 - "1.3.132.0.30", // secp160r2 - "1.3.132.0.33", // secp224r1 - "1.3.132.0.34", // secp384r1 - "1.3.132.0.35", // secp512r1 - NULL }; - - for(size_t j = 0; domains[j]; j++) + for(size_t j = 0; ec_domains[j]; j++) { - OID oid(domains[j]); - EC_Domain_Params params(oid); + EC_Domain_Params params(OIDS::lookup(ec_domains[j])); u32bit pbits = params.get_curve().get_p().bits(); |