diff --git a/ida.cpp b/ida.cpp index 615bf2f2..1c8b3ab2 100644 --- a/ida.cpp +++ b/ida.cpp @@ -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_inputChannelIds, m_outputChannelIds, m_outputToInput; std::vector m_outputChannelIdStrings; std::vector m_outputQueues; - int m_threshold; - unsigned int m_channelsReady, m_channelsFinished; std::vector > m_v; SecBlock m_u, m_w, m_y; + const GF2_32 m_gf32; + unsigned int m_channelsReady, m_channelsFinished; + int m_threshold; }; /// \brief Shamir's Secret Sharing Algorithm