diff options
author | Jack Lloyd <[email protected]> | 2016-12-26 01:24:09 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-26 01:24:09 -0500 |
commit | 2c08c1247666860285f90c859247c7eab98bda81 (patch) | |
tree | 7dc5f69e3615fee6e4aa824a5d9fcc8e4b70ab6a /src/tests/test_bigint.cpp | |
parent | 286d6d5273c3a0700949657e9b71c42efbd8cf29 (diff) |
Speed up DSA param gen test
Record counter value in test data, and start the search from there.
Diffstat (limited to 'src/tests/test_bigint.cpp')
-rw-r--r-- | src/tests/test_bigint.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp index 872cfc960..096788f17 100644 --- a/src/tests/test_bigint.cpp +++ b/src/tests/test_bigint.cpp @@ -531,13 +531,15 @@ BOTAN_REGISTER_TEST("bn_invmod", BigInt_InvMod_Test); class DSA_ParamGen_Test : public Text_Based_Test { public: - DSA_ParamGen_Test() : Text_Based_Test("bn/dsa_gen.vec", "P,Q,Seed") {} + DSA_ParamGen_Test() : Text_Based_Test("bn/dsa_gen.vec", "P,Q,Counter,Seed") {} Test::Result run_one_test(const std::string& header, const VarMap& vars) override { const std::vector<uint8_t> seed = get_req_bin(vars, "Seed"); - const Botan::BigInt P = get_req_bn(vars, "P"); - const Botan::BigInt Q = get_req_bn(vars, "Q"); + const size_t offset = get_req_sz(vars, "Counter"); + + const Botan::BigInt exp_P = get_req_bn(vars, "P"); + const Botan::BigInt exp_Q = get_req_bn(vars, "Q"); const std::vector<std::string> header_parts = Botan::split_on(header, ','); @@ -555,10 +557,10 @@ class DSA_ParamGen_Test : public Text_Based_Test try { Botan::BigInt gen_P, gen_Q; - if(Botan::generate_dsa_primes(Test::rng(), gen_P, gen_Q, p_bits, q_bits, seed)) + if(Botan::generate_dsa_primes(Test::rng(), gen_P, gen_Q, p_bits, q_bits, seed, offset)) { - result.test_eq("P", gen_P, P); - result.test_eq("Q", gen_Q, Q); + result.test_eq("P", gen_P, exp_P); + result.test_eq("Q", gen_Q, exp_Q); } else { |