Clear GCC unknown pragma warning

pull/836/head
Jeffrey Walton 2019-05-17 04:12:32 -04:00
parent 88c0789660
commit d112d4d1b0
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 13 additions and 0 deletions

13
rw.cpp
View File

@ -126,6 +126,7 @@ void InvertibleRWFunction::PrecomputeTweakedRoots() const
{
ModularArithmetic modp(m_p), modq(m_q);
#ifdef _OPENMP
#pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)
{
#pragma omp section
@ -135,6 +136,11 @@ void InvertibleRWFunction::PrecomputeTweakedRoots() const
#pragma omp section
m_pre_q_p = modp.Exponentiate(m_q, m_p - 2);
}
#else
m_pre_2_9p = modp.Exponentiate(2, (9 * m_p - 11)/8);
m_pre_2_3q = modq.Exponentiate(2, (3 * m_q - 5)/8);
m_pre_q_p = modp.Exponentiate(m_q, m_p - 2);
#endif
m_precompute = true;
}
@ -223,6 +229,7 @@ Integer InvertibleRWFunction::CalculateInverse(RandomNumberGenerator &rng, const
else
f = 2;
#ifdef _OPENMP
Integer W, X;
#pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)
{
@ -236,6 +243,12 @@ Integer InvertibleRWFunction::CalculateInverse(RandomNumberGenerator &rng, const
X = (f.IsUnit() ? t : modp.Multiply(m_pre_2_9p, t));
}
}
#else
const Integer W = (f.IsUnit() ? U : modq.Multiply(m_pre_2_3q, U));
const Integer t = modp.Multiply(modp.Exponentiate(V, 3), eh);
const Integer X = (f.IsUnit() ? t : modp.Multiply(m_pre_2_9p, t));
#endif
const Integer Y = W + q * modp.Multiply(m_pre_q_p, (X - W));
// Signature