Skip to content

Commit

Permalink
ff/baby_bear.hpp: fix a bug in bb31_4_t::reciprocal().
Browse files Browse the repository at this point in the history
Cast fuzzing net wider to catch the bug in recip_b2.
  • Loading branch information
dot-asm committed Aug 7, 2024
1 parent 65d71da commit c2cf400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ff/baby_bear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ class __align__(16) bb31_4_t {
wl = u[3] * (uint64_t)u[3];
wl += (w[0] * M) * (uint64_t)MOD; final_sub(w[1]);
wl = w[1] * (uint64_t)(MOD-BETA);
wl += u[1] * (uint64_t)(MOD-u[1]); final_sub(w[1]);
wl += u[0] * (uint64_t)(u[2]<<1);
wl += u[1] * (uint64_t)(MOD-u[1]);
wl += u[0] * (uint64_t)(u[2]<<1); final_sub(w[1]);
wl += (w[0] * M) * (uint64_t)MOD;

return bb31_t{final_sub(w[1])};
Expand Down

0 comments on commit c2cf400

Please sign in to comment.