RSA private exponentiation: multiply blinding invert in Mont - #6955
Merged
JacobBarthelmeh merged 1 commit intoNov 28, 2023
Merged
Conversation
SparkiDev
force-pushed
the
rsa_dec_inv_blind_mul_mont
branch
2 times, most recently
from
November 9, 2023 10:41
d3bc4a7 to
e1d99a8
Compare
philljj
self-requested a review
November 9, 2023 16:00
Contributor
|
Retest this please. |
Contributor
|
Testing for this in progress, will take a few days to see results. |
SparkiDev
force-pushed
the
rsa_dec_inv_blind_mul_mont
branch
2 times, most recently
from
November 14, 2023 06:46
a346f75 to
c1bcd57
Compare
Contributor
|
Testing in progress. |
When blinding, multiply result of exponentiation my blinding invert in Montgomery form to make code more constant time.
SparkiDev
force-pushed
the
rsa_dec_inv_blind_mul_mont
branch
from
November 17, 2023 05:20
c1bcd57 to
d3448e2
Compare
Contributor
|
New testing in progress. |
philljj
approved these changes
Nov 27, 2023
philljj
left a comment
Contributor
There was a problem hiding this comment.
Results look good, I am happy with this.
JacobBarthelmeh
approved these changes
Nov 28, 2023
JacobBarthelmeh
left a comment
Contributor
There was a problem hiding this comment.
Thanks Sean! Looks like possibly a slight decrease in RSA performance, but that's to be expected.
Before:
------------------------------------------------------------------------------
wolfSSL version 5.6.4
------------------------------------------------------------------------------
Math: Multi-Precision: Wolf(SP) word-size=64 bits=4096 sp_int.c
wolfCrypt Benchmark (block bytes 1048576, min 1.0 sec each)
RSA 2048 public 32500 ops took 1.002 sec, avg 0.031 ms, 32446.105 ops/sec
RSA 2048 private 600 ops took 1.141 sec, avg 1.902 ms, 525.736 ops/sec
After:
RSA 2048 public 32300 ops took 1.001 sec, avg 0.031 ms, 32269.664 ops/sec
RSA 2048 private 600 ops took 1.126 sec, avg 1.877 ms, 532.791 ops/sec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
When blinding, multiply result of exponentiation my blinding invert in Montgomery form to make code more constant time.
Fixes zd#16722
Testing
Normal
Checklist