summaryrefslogtreecommitdiff
path: root/nbtheory.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2004-02-10 02:30:58 +0000
committerweidai <weidai11@users.noreply.github.com>2004-02-10 02:30:58 +0000
commitc7b60eb80730a403c2aa837378b5b8ac6de4aedc (patch)
treeff6b82292fd7d635729e907a506f81dcb8e8323b /nbtheory.cpp
parent735020666ba28bffbdee18048d87d0ea9297bc57 (diff)
downloadcryptopp-git-c7b60eb80730a403c2aa837378b5b8ac6de4aedc.tar.gz
fix ignoring pSelector in FirstPrime
Diffstat (limited to 'nbtheory.cpp')
-rw-r--r--nbtheory.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/nbtheory.cpp b/nbtheory.cpp
index 7d857fbf..12514237 100644
--- a/nbtheory.cpp
+++ b/nbtheory.cpp
@@ -379,7 +379,7 @@ bool FirstPrime(Integer &p, const Integer &max, const Integer &equiv, const Inte
if (gcd != Integer::One())
{
// the only possible prime p such that p%mod==equiv where GCD(mod,equiv)!=1 is GCD(mod,equiv)
- if (p <= gcd && gcd <= max && IsPrime(gcd))
+ if (p <= gcd && gcd <= max && IsPrime(gcd) && (!pSelector || pSelector->IsAcceptable(gcd)))
{
p = gcd;
return true;