diff options
-rw-r--r-- | src/lib/math/numbertheory/monty_exp.cpp | 3 | ||||
-rw-r--r-- | src/lib/pubkey/ec_group/point_mul.cpp | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/math/numbertheory/monty_exp.cpp b/src/lib/math/numbertheory/monty_exp.cpp index 3451b1955..567492091 100644 --- a/src/lib/math/numbertheory/monty_exp.cpp +++ b/src/lib/math/numbertheory/monty_exp.cpp @@ -132,8 +132,7 @@ BigInt Montgomery_Exponentation_State::exponentiation_vartime(const BigInt& scal if(exp_nibbles == 0) return 1; - const uint32_t nibble = scalar.get_substring(m_window_bits*(exp_nibbles-1), m_window_bits); - Montgomery_Int x = m_g[nibble]; + Montgomery_Int x = m_g[scalar.get_substring(m_window_bits*(exp_nibbles-1), m_window_bits)]; for(size_t i = exp_nibbles - 1; i > 0; --i) { diff --git a/src/lib/pubkey/ec_group/point_mul.cpp b/src/lib/pubkey/ec_group/point_mul.cpp index 0124c70ef..760f060ce 100644 --- a/src/lib/pubkey/ec_group/point_mul.cpp +++ b/src/lib/pubkey/ec_group/point_mul.cpp @@ -255,11 +255,11 @@ PointGFp PointGFp_Var_Point_Precompute::mul(const BigInt& k, clear_mem(e.data(), e.size()); for(size_t i = 1; i != window_elems; ++i) { - const word mask = CT::is_equal<word>(w, i); + const word wmask = CT::is_equal<word>(w, i); for(size_t j = 0; j != elem_size; ++j) { - e[j] |= mask & m_T[i * elem_size + j]; + e[j] |= wmask & m_T[i * elem_size + j]; } } @@ -282,10 +282,10 @@ PointGFp PointGFp_Var_Point_Precompute::mul(const BigInt& k, clear_mem(e.data(), e.size()); for(size_t i = 1; i != window_elems; ++i) { - const word mask = CT::is_equal<word>(w, i); + const word wmask = CT::is_equal<word>(w, i); for(size_t j = 0; j != elem_size; ++j) - e[j] |= mask & m_T[i * elem_size + j]; + e[j] |= wmask & m_T[i * elem_size + j]; } R.add(&e[0], m_p_words, &e[m_p_words], m_p_words, &e[2*m_p_words], m_p_words, ws); |