-
Notifications
You must be signed in to change notification settings - Fork 778
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
[aes] Also advance the masking PRNG when not used during processing #22844
Conversation
Signed-off-by: Pirmin Vogel <[email protected]>
I still need to run the FPGA experiments which will happen tomorrow most likely. |
This change doesn't alter the functionality or the masking employed inside AES but rather moves some PRD buffers around to facilite a subsequent change improving SCA hardening. Signed-off-by: Pirmin Vogel <[email protected]>
Signed-off-by: Pirmin Vogel <[email protected]>
Previously, we were using the unbuffered PRNG output for input data masking which is non-ideal from an SCA perspective as the PRNG output may be subject to glitches during updating. Signed-off-by: Pirmin Vogel <[email protected]>
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, looks good for me from a security point of view!
Are you planning to share the results from the FPGA measurement? Would be interesting for me to see the effect of advancing the PRNG.
end | ||
|
||
// Advance the masking PRNG based on the FSM and the shift register. | ||
assign prng_update_o = prng_update | prd_q[0]; |
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.
@vogelpi please let's discuss this and L497 shortly
Thanks for your reviews @johannheyszl, @nasahlpa and @andreaskurth . SCA results look all good but I've discussed with @johannheyszl and @nasahlpa that it's probably better to always let the PRNG advance when some processing is going on. I'll change the design accordingly. |
Thanks @vogelpi ! |
Advancing the masking PRNG even when it's not used during processing is beneficial from an SCA hardening perspective as it increases the noise. Signed-off-by: Pirmin Vogel <[email protected]>
The counter is not needed in this state anyway but since the PRNG reseeding may take quite a while, it's better to not update the counter to save power. Signed-off-by: Pirmin Vogel <[email protected]>
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.
More catch-up, LGTM (I especially like the extra noise from randomly advancing the masking PRNG)
This PR contains a couple of changes, but only two of them have functional/SCA impact:
I suggest disabling showing whitespace changes during the review as this PR contains some alignment changes to port lists.
For the other commits:
Update: As outline here the PR has been reworked such that the PRNG is not advanced randomly but unconditionally during data processing to constantly increase the noise floor.