Skip to content

Commit

Permalink
msm/pippenger.cuh: clear scalar's msb with abs() method.
Browse files Browse the repository at this point in the history
This helps Pasta curves, which have sparse moduli.
  • Loading branch information
dot-asm committed Feb 20, 2024
1 parent a7766e4 commit 2a43112
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions msm/pippenger.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ void breakdown(vec2d_t<uint32_t> digits, const scalar_t scalars[], size_t len,
#endif

// clear the most significant bit
uint32_t msb = s[top_i] >> ((scalar_t::nbits - 1) % 32);
s.cneg(msb);
uint32_t msb = s.abs();
msb <<= 31;

scalar = s;
Expand Down

0 comments on commit 2a43112

Please sign in to comment.