Skip to content
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

[hmac] Wipe secret assertions and spec update #25674

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

martin-velay
Copy link
Contributor

- fix doc to be aligned with the RTL as the FSMs are not affected by the
wipe secret triggering. But this is not a security issue.

Signed-off-by: Martin Velay <[email protected]>
@martin-velay martin-velay marked this pull request as ready for review December 17, 2024 09:41
@martin-velay
Copy link
Contributor Author

@andreaskurth, as discussed the doc update should fall into the earlgrey_1.0.0 as well. What about the assertions? Should I better split this PR in 2 pieces or that OK to update the "RTL" (which is not really an RTL change)? (BTW, that's a case where the assertions binding is preferable IMO).

hw/ip/hmac/data/hmac.hjson Outdated Show resolved Hide resolved
hw/ip/hmac/rtl/hmac.sv Outdated Show resolved Hide resolved
hw/ip/hmac/rtl/hmac.sv Outdated Show resolved Hide resolved
hw/ip/prim/rtl/prim_sha2.sv Outdated Show resolved Hide resolved
hw/ip/hmac/rtl/hmac.sv Outdated Show resolved Hide resolved
hw/ip/prim/rtl/prim_sha2.sv Outdated Show resolved Hide resolved
@@ -264,6 +276,19 @@ module prim_sha2 import prim_sha2_pkg::*;
assign digest_o[i][31:0] = digest256_q[i];
assign digest_o[i][63:32] = 32'b0;
end

`ifndef SYNTHESIS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this ifndef?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry: that wasn't very explicit. I think that prim_assert.sv will include dummy versions of all the assertion macros if SYNTHESIS is defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed it, but can you explain me the internal guidance around this ifdef?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ifndef SYNTHESIS is required only if you generate additional signals required to formulate the assertions. In some cases, we need to even generate a bunch of flops just to formulate the assertions, of course we don't want to synthesize these flops :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand better now. Thanks !

@andreaskurth
Copy link
Contributor

@andreaskurth, as discussed the doc update should fall into the earlgrey_1.0.0 as well. What about the assertions? Should I better split this PR in 2 pieces or that OK to update the "RTL" (which is not really an RTL change)? (BTW, that's a case where the assertions binding is preferable IMO).

Thanks @martin-velay, I think this PR should fully be cherry-picked to earlgrey_1.0.0

@martin-velay martin-velay added the CherryPick:earlgrey_1.0.0 This PR should be cherry-picked to earlgrey_1.0.0 label Dec 20, 2024
- add multiple assertions to ensure that the specified internal
variables are cleared when a wipe secret operation is triggered.

Signed-off-by: Martin Velay <[email protected]>
@martin-velay
Copy link
Contributor Author

Thanks for your review @rswarbrick !

@vogelpi
Copy link
Contributor

vogelpi commented Dec 20, 2024

CHANGE AUTHORIZED: hw/ip/hmac/data/hmac.hjson
CHANGE AUTHORIZED: hw/ip/hmac/rtl/hmac.sv
CHANGE AUTHORIZED: hw/ip/prim/rtl/prim_sha2.sv

@rswarbrick
Copy link
Contributor

CHANGE AUTHORIZED: hw/ip/hmac/data/hmac.hjson
CHANGE AUTHORIZED: hw/ip/hmac/rtl/hmac.sv
CHANGE AUTHORIZED: hw/ip/prim/rtl/prim_sha2.sv

@vogelpi vogelpi merged commit 3ff8ddc into lowRISC:master Jan 7, 2025
38 checks passed
Copy link

github-actions bot commented Jan 7, 2025

Successfully created backport PR for earlgrey_1.0.0:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPick:earlgrey_1.0.0 This PR should be cherry-picked to earlgrey_1.0.0 IP:hmac
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants