summaryrefslogtreecommitdiff
path: root/xtr.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-07-26 16:03:14 -0400
committerJeffrey Walton <noloader@gmail.com>2015-07-26 16:03:14 -0400
commitb7de164d6251dc066123b59bc15d30c74e920756 (patch)
tree650e67242386d55616a2038c5cbc7042568ed377 /xtr.cpp
parent7b64ca489a7e1da36b02b4a35d149275914d8268 (diff)
downloadcryptopp-git-b7de164d6251dc066123b59bc15d30c74e920756.tar.gz
Cut-in CRYPTOPP_ASSERT in all remaining header and source files
Diffstat (limited to 'xtr.cpp')
-rw-r--r--xtr.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/xtr.cpp b/xtr.cpp
index 9d36e14c..ce687ea1 100644
--- a/xtr.cpp
+++ b/xtr.cpp
@@ -16,8 +16,8 @@ const GFP2Element & GFP2Element::Zero()
void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer &q, GFP2Element &g, unsigned int pbits, unsigned int qbits)
{
- assert(qbits > 9); // no primes exist for pbits = 10, qbits = 9
- assert(pbits > qbits);
+ CRYPTOPP_ASSERT(qbits > 9); // no primes exist for pbits = 10, qbits = 9
+ CRYPTOPP_ASSERT(pbits > qbits);
const Integer minQ = Integer::Power2(qbits - 1);
const Integer maxQ = Integer::Power2(qbits) - 1;
@@ -28,11 +28,11 @@ void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer
do
{
bool qFound = q.Randomize(rng, minQ, maxQ, Integer::PRIME, 7, 12);
- assert(qFound); CRYPTOPP_UNUSED(qFound);
+ CRYPTOPP_ASSERT(qFound); CRYPTOPP_UNUSED(qFound);
bool solutionsExist = SolveModularQuadraticEquation(r1, r2, 1, -1, 1, q);
- assert(solutionsExist); CRYPTOPP_UNUSED(solutionsExist);
+ CRYPTOPP_ASSERT(solutionsExist); CRYPTOPP_UNUSED(solutionsExist);
} while (!p.Randomize(rng, minP, maxP, Integer::PRIME, CRT(rng.GenerateBit()?r1:r2, q, 2, 3, EuclideanMultiplicativeInverse(p, 3)), 3*q));
- assert(((p.Squared() - p + 1) % q).IsZero());
+ CRYPTOPP_ASSERT(((p.Squared() - p + 1) % q).IsZero());
GFP2_ONB<ModularArithmetic> gfp2(p);
GFP2Element three = gfp2.ConvertIn(3), t;
@@ -48,7 +48,7 @@ void XTR_FindPrimesAndGenerator(RandomNumberGenerator &rng, Integer &p, Integer
if (g != three)
break;
}
- assert(XTR_Exponentiate(g, q, p) == three);
+ CRYPTOPP_ASSERT(XTR_Exponentiate(g, q, p) == three);
}
GFP2Element XTR_Exponentiate(const GFP2Element &b, const Integer &e, const Integer &p)