aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-04-25 00:37:28 +0000
committerlloyd <[email protected]>2014-04-25 00:37:28 +0000
commitb9bee0898aed28bfaf560f85cd63d1534813c257 (patch)
tree888350b90fffaf2a1cf9e42441b9dfda3df5cabc /src/tests
parent6c0912310f611286cd28b06a45e5dca8899ac04d (diff)
Any fixed MR iterations is probably wrong for somebody. Allow the user
to specify a probability as well as if n was randomly chosen or not. If the input is random use a better bounds to reduce the number of needed tests.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_bigint.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp
index 87de4aff3..2404dad5a 100644
--- a/src/tests/test_bigint.cpp
+++ b/src/tests/test_bigint.cpp
@@ -329,17 +329,17 @@ size_t check_powmod(const std::vector<std::string>& args)
}
/* Make sure that n is prime or not prime, according to should_be_prime */
-size_t check_primetest(const std::vector<std::string>& args,
+size_t is_primetest(const std::vector<std::string>& args,
Botan::RandomNumberGenerator& rng)
{
BigInt n(args[0]);
bool should_be_prime = (args[1] == "1");
- bool is_prime = Botan::verify_prime(n, rng);
+ bool is_prime = Botan::is_prime(n, rng);
if(is_prime != should_be_prime)
{
- std::cout << "ERROR: verify_prime" << std::endl;
+ std::cout << "ERROR: is_prime" << std::endl;
std::cout << "n = " << n << std::endl;
std::cout << is_prime << " != " << should_be_prime << std::endl;
}
@@ -429,7 +429,7 @@ size_t test_bigint()
else if(algorithm.find("ModExp") != std::string::npos)
new_errors = check_powmod(substr);
else if(algorithm.find("PrimeTest") != std::string::npos)
- new_errors = check_primetest(substr, rng);
+ new_errors = is_primetest(substr, rng);
else
std::cout << "Unknown MPI test " << algorithm << std::endl;