- Notifications
You must be signed in to change notification settings - Fork 2.8k
[3.6] Rsa: use the CRT to generate base blinding values #10513
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
base: mbedtls-3.6
Are you sure you want to change the base?
Conversation
Will gain a new implementation using the CRT, so we want to hide the upcoming complexity in a dedicated function. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Was only used in one place so far, but will be used in rsa_gen_rand_with_inverse()'s upcoming CRT-based implementation. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
gilles-peskine-arm left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for nominal RSA keys, but I don't see why the CRT version would make a difference with respect to the number of retries to find a suitable blinding value.
I haven't run any benchmarks.
Previously we were looping in one case but not even checking the other. Let's check both cases and error out immediately. The error path should never be taken in pratice anyway. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This only made the function harder to use. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
gilles-peskine-arm left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but the CI is unhappy about the NO_CRT code.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
| Ah, quite embarrassing, I didn't even build that config before pushing. Let me try again. |
gilles-peskine-arm left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
In builds where
MBEDTLS_RSA_NO_CRTis disabled, take advantage of the CRT when generating the initial value for base blinding.Fixes #10476
PR checklist