Clear GCC unknown pragma warning
parent
88c0789660
commit
d112d4d1b0
13
rw.cpp
13
rw.cpp
|
|
@ -126,6 +126,7 @@ void InvertibleRWFunction::PrecomputeTweakedRoots() const
|
||||||
{
|
{
|
||||||
ModularArithmetic modp(m_p), modq(m_q);
|
ModularArithmetic modp(m_p), modq(m_q);
|
||||||
|
|
||||||
|
#ifdef _OPENMP
|
||||||
#pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)
|
#pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)
|
||||||
{
|
{
|
||||||
#pragma omp section
|
#pragma omp section
|
||||||
|
|
@ -135,6 +136,11 @@ void InvertibleRWFunction::PrecomputeTweakedRoots() const
|
||||||
#pragma omp section
|
#pragma omp section
|
||||||
m_pre_q_p = modp.Exponentiate(m_q, m_p - 2);
|
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;
|
m_precompute = true;
|
||||||
}
|
}
|
||||||
|
|
@ -223,6 +229,7 @@ Integer InvertibleRWFunction::CalculateInverse(RandomNumberGenerator &rng, const
|
||||||
else
|
else
|
||||||
f = 2;
|
f = 2;
|
||||||
|
|
||||||
|
#ifdef _OPENMP
|
||||||
Integer W, X;
|
Integer W, X;
|
||||||
#pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)
|
#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));
|
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));
|
const Integer Y = W + q * modp.Multiply(m_pre_q_p, (X - W));
|
||||||
|
|
||||||
// Signature
|
// Signature
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue