Skip to content

Commit

Permalink
[test] refactor mont.hpp in test
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Feb 1, 2024
1 parent dad162b commit e8efab8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/mont.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ class Montgomery {
mR = 1;
mR = (mR << (N * sizeof(Unit) * 8)) % mp;
mR2 = (mR * mR) % mp;
v_.resize(N * 2);
Unit *base = &v_[N];
v_.resize(N + 1);
Unit *base = &v_[1];
mcl::gmp::getArray(base, N, _p);
rp = mcl::bint::getMontgomeryCoeff(v_[0]);
base[-1] = rp = mcl::bint::getMontgomeryCoeff(base[0]);
p = base;
rp = base[-1];
isFullBit = p[N - 1] >> (sizeof(Unit) * 8 - 1);
}

Expand Down

0 comments on commit e8efab8

Please sign in to comment.