Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase number of attempts before failure in ECDSA-DER #33933

Merged
merged 2 commits into from
Mar 22, 2020

Conversation

bartonjs
Copy link
Member

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.

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.
@bartonjs bartonjs added area-System.Security test-bug Problem in test source code (most likely) labels Mar 22, 2020
@bartonjs bartonjs added this to the 5.0 milestone Mar 22, 2020
@ghost
Copy link

ghost commented Mar 22, 2020

Hello @bartonjs!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@jkotas jkotas merged commit eb54d9f into dotnet:master Mar 22, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
@bartonjs bartonjs deleted the increase_test_tolerance branch April 9, 2021 21:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security test-bug Problem in test source code (most likely)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECDsaSpanSignatureFormatTests.Rfc23279TrySignHashUnderMax test failure
4 participants