Increase number of attempts before failure in ECDSA-DER #33933
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Of the four test keys, 3 have a 75% chance of being smaller than max on each call.
(1 - 0.75) ^ 10 = 9.5e-7, so failure happens slightly more rarely than 1 in a million.
The fourth test key only has a 43.75% chance (1 - (.75 * .75)) of being smaller,
and (1 - .4375) ^ 10 = 3.1e-3, so slightly more likely than 3 per thousand.
Raising the iteration count to 36 brings the fourth key odds of failure to about 1 in a billion (1.01e-9).
36 iterations makes the other 3 fail at 1e-22; but 1e-9 is attained at 15 iterations.
Fixes #33904.