diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-12-03 08:32:22 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-12-03 08:32:22 -0500 |
commit | 13f7bd7ffb3150f3bdeba4ba3f8794c30ac44065 (patch) | |
tree | bb6f881f77f270fc140bdb98b406475ea45209b2 /ida.cpp | |
parent | 0b1162aa34a805fb46a7f514894ad26a39d58349 (diff) | |
download | cryptopp-git-13f7bd7ffb3150f3bdeba4ba3f8794c30ac44065.tar.gz |
Make GF2_32 class member of RawIDA
Diffstat (limited to 'ida.cpp')
-rw-r--r-- | ida.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -6,14 +6,9 @@ #include "ida.h"
#include "stdcpp.h"
#include "algebra.h"
-#include "gf2_32.h"
#include "polynomi.h"
#include "polynomi.cpp"
-ANONYMOUS_NAMESPACE_BEGIN
-const CryptoPP::GF2_32 field;
-NAMESPACE_END
-
NAMESPACE_BEGIN(CryptoPP)
#if (defined(_MSC_VER) && (_MSC_VER < 1400)) && !defined(__MWERKS__)
@@ -145,7 +140,7 @@ void RawIDA::ComputeV(unsigned int i) if (m_outputToInput[i] == size_t(m_threshold) && i * size_t(m_threshold) <= 1000*1000)
{
m_v[i].resize(m_threshold);
- PrepareBulkPolynomialInterpolationAt(field, m_v[i].begin(), m_outputChannelIds[i], &(m_inputChannelIds[0]), m_w.begin(), m_threshold);
+ PrepareBulkPolynomialInterpolationAt(m_gf32, m_v[i].begin(), m_outputChannelIds[i], &(m_inputChannelIds[0]), m_w.begin(), m_threshold);
}
}
@@ -161,7 +156,7 @@ void RawIDA::AddOutputChannel(word32 channelId) void RawIDA::PrepareInterpolation()
{
CRYPTOPP_ASSERT(m_inputChannelIds.size() == size_t(m_threshold));
- PrepareBulkPolynomialInterpolation(field, m_w.begin(), &(m_inputChannelIds[0]), (unsigned int)(m_threshold));
+ PrepareBulkPolynomialInterpolation(m_gf32, m_w.begin(), &(m_inputChannelIds[0]), (unsigned int)(m_threshold));
for (unsigned int i=0; i<m_outputChannelIds.size(); i++)
ComputeV(i);
}
@@ -190,12 +185,12 @@ void RawIDA::ProcessInputQueues() if (m_outputToInput[i] != size_t(m_threshold))
m_outputQueues[i].PutWord32(m_y[m_outputToInput[i]]);
else if (m_v[i].size() == size_t(m_threshold))
- m_outputQueues[i].PutWord32(BulkPolynomialInterpolateAt(field, m_y.begin(), m_v[i].begin(), m_threshold));
+ m_outputQueues[i].PutWord32(BulkPolynomialInterpolateAt(m_gf32, m_y.begin(), m_v[i].begin(), m_threshold));
else
{
m_u.resize(m_threshold);
- PrepareBulkPolynomialInterpolationAt(field, m_u.begin(), m_outputChannelIds[i], &(m_inputChannelIds[0]), m_w.begin(), m_threshold);
- m_outputQueues[i].PutWord32(BulkPolynomialInterpolateAt(field, m_y.begin(), m_u.begin(), m_threshold));
+ PrepareBulkPolynomialInterpolationAt(m_gf32, m_u.begin(), m_outputChannelIds[i], &(m_inputChannelIds[0]), m_w.begin(), m_threshold);
+ m_outputQueues[i].PutWord32(BulkPolynomialInterpolateAt(m_gf32, m_y.begin(), m_u.begin(), m_threshold));
}
}
}
|