Skip to content

Commit

Permalink
Fix random test failure introduced by #4385
Browse files Browse the repository at this point in the history
Fixes #4415
  • Loading branch information
randombit committed Oct 27, 2024
1 parent 0550c5c commit 8550241
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tests/test_ec_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ Botan::BigInt test_integer(Botan::RandomNumberGenerator& rng, size_t bits, const
}
}

if(x == 0) {
// EC_Scalar rejects zero as an input
return test_integer(rng, bits, max);
}

if(max > 0) {
while(x >= max) {
const size_t b = x.bits() - 1;
Expand Down

0 comments on commit 8550241

Please sign in to comment.