-
Notifications
You must be signed in to change notification settings - Fork 1
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] Masked GHASH implementation #8
Conversation
Signed-off-by: Pirmin Vogel <[email protected]>
Previously, we restored a previously saved GHASH state by first overwriting the initialized state with the masked cipher core input and second subtracting Share 1 of S to the GHASH state afterwards. This commit changes the design to overwrite only Share 0 of the initialized state with the unmasked saved state and leave Share 1 untouched. As Share 1 of the state is already initialized to Share 1 of S, no further operations have to be done. This allows saving one 128-bit multiplexer input (or 300 GE). Signed-off-by: Pirmin Vogel <[email protected]>
Signed-off-by: Pirmin Vogel <[email protected]>
This allows speeding up the masking verification. Signed-off-by: Pirmin Vogel <[email protected]>
Signed-off-by: Pirmin Vogel <[email protected]>
This is preferrable from a side-channel perspective as it reduces SCA leakage related to S. Signed-off-by: Pirmin Vogel <[email protected]>
This commit aligns the unmasked and masked implementation of the GHASH block regarding state saving and restoring. In both cases, the sum of the GHASH state and S are saved. After restoring, S is again subtracted also for the unmasked implementation. This allows saving one 128-bit multiplexer input and it allows exchanging saved states between unmasked and masked implementations which simplifies DV. 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.
Are you planning to add the documentation to this PR or will this be added later? It would help reviewing the PR, but from a first look it looks good to me.
I am currently writing the documentation for this but it will be in a separate doc for the time being. |
CHANGE AUTHORIZED: hw/ip/aes/rtl/aes_control_fsm.sv This PR touches AES RTL files but this is expected. |
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.
I had a more thorough look into the masking and I think it looks good.
CHANGE AUTHORIZED: hw/ip/aes/rtl/aes_control_fsm.sv This PR touches AES RTL files but this is expected. |
Thanks you both for your reviews. I'll share the spec as soon as it's ready. I am merging this now. |
This PR contains the initial RTL for the masked GHASH implementation.
The design is functionally correct and passes first masking verification experiments. This means we shouldn't consider the masking verification done yet but we can be reasonably confident that the design will not need to be radically changed.