Skip to content

Commit

Permalink
check that MSB of modulus is not 0
Browse files Browse the repository at this point in the history
otherwise B<M case may not be true by setting MSB of base to 0
  • Loading branch information
spoonincode committed Sep 14, 2023
1 parent aee9599 commit d3275c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchmark/modexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void modexp_benchmarking() {
};

//some modexp implementations need to take a minor different path if base is greater than modulus, try both
FC_ASSERT(modulus[0] != '\xff');
FC_ASSERT(modulus[0] != '\xff' && modulus[0] != 0);
base.front() = 0;
even_and_odd("B<M");
base.front() = '\xff';
Expand Down

0 comments on commit d3275c2

Please sign in to comment.