-
Notifications
You must be signed in to change notification settings - Fork 914
[crypto] Check if byte-copy was successful #28773
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: master
Are you sure you want to change the base?
Conversation
johannheyszl
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.
Thanks @nasahlpa !
After a byte-wise copy using randomized_bytecopy() use the function consttime_memeq_byte() to check if copying the data was successful. This is a FI mitigation. Closes lowRISC#28753. Signed-off-by: Pascal Nasahl <[email protected]>
1250168 to
c023447
Compare
h-filali
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.
Thanks @nasahlpa for adding this!
Do we think we should randomize consttime_memeq_byte as well to avoid leakage?
To reduce SCA leakage, randomize the order we are reading from the two buffers. This is in-line with other functions in `hardened_memory`. Signed-off-by: Pascal Nasahl <[email protected]>
Thanks Hakim - yes this is a good point. I've pushed another commit that does the randomization of the |
h-filali
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.
Thanks @nasahlpa. Checked out the second commit and this LGTM!
After a byte-wise copy using randomized_bytecopy() use the function consttime_memeq_byte() to check if copying the data was successful. This is a FI mitigation.
Closes #28753.