summaryrefslogtreecommitdiff
path: root/validat0.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-03-26 23:49:04 -0400
committerJeffrey Walton <noloader@gmail.com>2018-03-26 23:49:04 -0400
commit36bde8eab53ca9efb519b278f1a9e87892f8af3b (patch)
treece1bef2b63d7cd664c940f3ab155285ab38cfb24 /validat0.cpp
parent9ab3f61810f11529e8e5736aecba9d91063ad5dc (diff)
downloadcryptopp-git-36bde8eab53ca9efb519b278f1a9e87892f8af3b.tar.gz
Switch to <nbtheory.h> functions
Diffstat (limited to 'validat0.cpp')
-rw-r--r--validat0.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/validat0.cpp b/validat0.cpp
index 9f03533c..027c2e94 100644
--- a/validat0.cpp
+++ b/validat0.cpp
@@ -3158,7 +3158,7 @@ bool TestIntegerOps()
try {
Integer x = 0;
Integer y = 0;
- Integer z = a_times_b_mod_c(y, y, x);
+ Integer z = ModularMultiplication(y, y, x);
result = false;
}
catch(const Integer::DivideByZero&) {
@@ -3356,7 +3356,7 @@ bool TestIntegerOps()
if (x != y)
{
- result = (Integer::Gcd(x,y) == 1);
+ result = (RelativelyPrime(x, y) == true);
pass = result && pass;
if (!result)
@@ -3396,8 +3396,8 @@ bool TestIntegerOps()
Integer y = (a % m).InverseMod(m);
Integer z = (a * y).Modulo(m);
- if (GCD(a,m) == 1) // coprime?
- result = (x == y) && (z == 1) && (a_times_b_mod_c(a, x, m) == 1);
+ if (RelativelyPrime(a, m) == true)
+ result = (x == y) && (z == 1) && (ModularMultiplication(a, x, m) == 1);
else
result = (x == y);
@@ -3449,8 +3449,8 @@ bool TestIntegerOps()
Integer y = (a % m).InverseMod(m);
Integer z = (a * y).Modulo(m);
- if (GCD(a,m) == 1) // coprime?
- result = (x == y) && (z == 1) && (a_times_b_mod_c(a, x, m) == 1);
+ if (RelativelyPrime(a, m) == true)
+ result = (x == y) && (z == 1) && (ModularMultiplication(a, x, m) == 1);
else
result = (x == y);
@@ -3470,8 +3470,8 @@ bool TestIntegerOps()
Integer y = (a % m).InverseMod(m);
Integer z = (a * y).Modulo(m);
- if (GCD(a,m) == 1) // coprime?
- result = (x == y) && (z == 1) && (a_times_b_mod_c(a, x, m) == 1);
+ if (RelativelyPrime(a, m) == true)
+ result = (x == y) && (z == 1) && (ModularMultiplication(a, x, m) == 1);
else
result = (x == y);
@@ -3498,7 +3498,7 @@ bool TestIntegerOps()
Integer y = Integer(Integer::POSITIVE, 0, ri.InverseMod(m));
Integer z = Integer(Integer::POSITIVE, 0, (a * y).Modulo(m));
- if (GCD(a,mi) == 1) // coprime?
+ if (GCD(a,mi) == 1)
result = (x == y) && (z == 1);
else
result = (x == y);