Skip to content

Commit

Permalink
fix msm::toArray for gmp
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Jun 12, 2024
1 parent 4f17435 commit 9589682
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/msm_avx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ inline void dump(const Vec& v, const char *msg = nullptr)
}

template<size_t N, int w = W>
inline void toArray(Unit x[N], mpz_class mx)
inline void toArray(Unit x[N], const mpz_class& mx)
{
const Unit mask = getMask(w);
Unit tmp[N];
mcl::gmp::getArray(tmp, N, mx);
for (size_t i = 0; i < N; i++) {
mpz_class a = mx & mask;
x[i] = mcl::gmp::getUnit(a)[0];
mx >>= w;
x[i] = mcl::fp::getUnitAt(tmp, N, i*w) & mask;
}
}

Expand Down

0 comments on commit 9589682

Please sign in to comment.