| 26 | } |
| 27 | |
| 28 | template <class T> void DL_FixedBasePrecomputationImpl<T>::Precompute(const DL_GroupPrecomputation<Element> &group, unsigned int maxExpBits, unsigned int storage) |
| 29 | { |
| 30 | CRYPTOPP_ASSERT(m_bases.size() > 0); |
| 31 | CRYPTOPP_ASSERT(storage <= maxExpBits); |
| 32 | |
| 33 | if (storage > 1) |
| 34 | { |
| 35 | m_windowSize = (maxExpBits+storage-1)/storage; |
| 36 | m_exponentBase = Integer::Power2(m_windowSize); |
| 37 | } |
| 38 | |
| 39 | m_bases.resize(storage); |
| 40 | for (unsigned i=1; i<storage; i++) |
| 41 | m_bases[i] = group.GetGroup().ScalarMultiply(m_bases[i-1], m_exponentBase); |
| 42 | } |
| 43 | |
| 44 | template <class T> void DL_FixedBasePrecomputationImpl<T>::Load(const DL_GroupPrecomputation<Element> &group, BufferedTransformation &bt) |
| 45 | { |
no test coverage detected