-
Notifications
You must be signed in to change notification settings - Fork 117
language correction and speed-up #206
language correction and speed-up #206
Conversation
added fast CRT-based decryption to core added multiprime key support correction (see issue sybrenstuvel#205, PR sybrenstuvel#206) added multiprime tests
This actually helps! +1 |
Please do only one thing per PR. Combining changes muddles the discussion and makes things harder to accept (because everything has to be good in order to accept the PR). In this case, moving the size check forward will make the timing of the 'happy flow' and 'unhappy flow' more distinct. Wouldn't this make it easier for an attacker to figure out the code path taken, as it'll be possible to distinguish between the different failure modes? |
Sorry, I considered them related because only making the correction/speed-up causes a test to fail. I did not see a way to decouple the two problems.
You're absolutely right about that. To be sure I wasn't missing anything, I traced the commit history for the source and found "Fix BB'06 attack in verify()..." in the commit message. The source claims the attack is only good against keys with exponent of 3. This is not good practice, but we can't control what users do and should definitely try to protect them even when they make mistakes. The source also says the attack depends on "a failure to check a certain condition while verifying the RSA signature." Specifically, "The error that Bleichenbacher exploits is if the implementation does not check that the hash+ASN.1 data is right-justified within the PKCS-1 padding." This concern is unrelated to my changes. Nonetheless, the commit author says their article is about a "straightforward variant" of BB'06. I read through the article and determined the concerns there were unrelated to my changes. Finally, I found the relevant commit (here). |
Thank you for your elaborate explanation, that makes it very simple to now hit the 'merge' button :) |
Hmm the automated build failed, could you take a look at that @myheroyuki ? |
Never mind, must have been a hickup @ Github. Triggering the actions to run again did complete them all succesfully. |
added fast CRT-based decryption to core added multiprime key support correction (see issue sybrenstuvel#205, PR sybrenstuvel#206) added multiprime tests
added fast CRT-based decryption to core added multiprime key support correction (see issue sybrenstuvel#205, PR sybrenstuvel#206) added multiprime tests
Addresses #205. I also moved an assert check up since the blinding will usually add length to the signed message which caused the appending zeroes test to fail with a different exception. If this doesn't seem right let me know!