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] D2(S) Signoff #20996

Closed
msfschaffner opened this issue Jan 25, 2024 · 7 comments · Fixed by #22340
Closed

[hmac] D2(S) Signoff #20996

msfschaffner opened this issue Jan 25, 2024 · 7 comments · Fixed by #22340

Comments

@msfschaffner
Copy link
Contributor

Description

Ensure D2 signoff criteria are fulfilled after focus area changes have landed.

@andreaskurth
Copy link
Contributor

andreaskurth commented Mar 28, 2024

Commits since Earlgrey-ES tapeout

git rev-parse HEAD

d748311

git log Earlgrey-M2.5.2-RC0..HEAD --oneline hw/ip/hmac
  • 77abd32 [spec] Update hmac spec to clarify WIPE_SECRET behavior.
    --> specification clarification
  • 24a4034 [hmac,waiver] Update HMAC AscentLint waiver
    85f443c [hmac,data/doc] Add features and update documentation
    e475a92 [hmac,dv] Support new HMAC IP in DV
    6e59b6c [hmac,dv] Add DPI C support for HMAC SHA-384/512
    37a1499 [dv,cryptoc_dpi] Test utility
    b90a8cc [dv,cryptoc_dpi] SHA-384/512 support
    7ef0629 [hmac,core] Update HMAC description
    9b804a3 [hmac,regs] Extend CSRS for wider digest/key length
    136ca2a [hmac,rtl] RTL changes to support configurable wider digest
    --> All those commits are part of [hmac] Implementation of wider digest & configurable key length #21604:
  • dd041b9 [dv,otp_ctrl] Fix issues related to random resets
    --> no RTL nor specification changed
  • 7e196e6 [hmac] Change fifo_empty interrupt type to status
    --> Change of interrupt type to status. Documentation updated. One TODO item added, which links the verification of this change ([hmac] Verify FIFO empty status interrupt #21815), which is tracked for M4.
  • 06fad37 [hmac] Fix Verilator lint error
    --> RTL changed but no functional difference
  • 6a9f12c [hmac,verilator] Remove lint waivers for nonexistent file
    --> no RTL nor specification changed
  • 0ebe13d [hmac/doc] Document context save & restore
    d739893 [hmac/dv] Randomly save & restore in wr_msg task
    f151ba8 [hmac/dv] Add randomization knob to exercise save & restore
    064b6dd [hmac] Signal done also when told to stop and hash is complete
    6ceb542 [hmac] Implement hash stop command
    252361c [prim_sha2] Add hash_running_o
    5f5355b [hmac] Remove event_intr signal
    493229a [hmac] Implement hash continue command
    096c457 [hmac] Implement hash continuing in hmac_core
    e97ec53 [hmac/dv] Add functions to stop and continue
    582fb60 [hmac] Add stop and continue bits to CMD CSR
    bba4794 [prim_sha2] Add hash_continue_i
    a62a1b0 [hmac/dv] Add task to write the MSG_LENGTH CSR
    a510490 [hmac/dv] Scoreboard changes for making MSG_LENGTH CSR writable
    1930c0e [hmac] Make MSG_LENGTH CSRs SW-writable
    b2db371 [hmac] Remove assertion that message_length must be stable
    e3b4afe [hmac/dv] Add task that outputs the value read from message length CSR
    d0099ed [hmac/dv] Print digest registers in csr_rd_digest
    5ad9a69 [hmac/dv] Print expected digest when calculating it
    0bb77b0 [hmac/dv] Scoreboard change for making DIGEST CSR SW-writable
    446614e [hmac/dv] Add task to write DIGEST CSR
    acf14b5 [hmac] Connect digest SW outputs to HW
    10e3b27 [hmac] Make DIGEST CSR SW-writable
    778250b [hmac/dv] Exclude CFG.digest_swap CSR field from automated write tests
    4f39118 [hmac/dv] Exclude WIPE_SECRET CSR from automated write tests
    67de537 [prim_sha2] Make digest writable from input while disabled
    --> All those commits are part of [hmac] Initial implementation of save & restore #21307:
    • The documentation has been updated to include the added feature.
    • Two TODO items were added, and these should get resolved during the addition of the SHA-384/512 support.
    • There is preliminary DV code to verify this but it's currently not enabled. Issue [hmac/dv] Verify save & restore #21708 tracks the verification of this feature as part of M4.
  • cce79e2 [hmac] Bump version to 2.0.0 and reset development stages
    --> no RTL nor specification changed
  • 2290dcc [hw,hmac,rtl] Remove unused SHA2 code
    --> RTL changed but no functional difference
  • 3760034 [hmac,syn] Add cfg and constraints to support HMAC synthesis
    --> no RTL nor specification changed
  • 8386553 [hmac,dv] Update HMAC UNR-generated coverage exclusions
    --> no RTL nor specification changed
  • 58fc788 [hmac/rtl] Update HMAC to instantiate SHA-2 prim
    --> RTL changed but no functional difference
  • 61a237e [util/reggen] reverse order of substruct generation
    --> RTL changed but no functional difference
  • fc84846 [reggen,hw] Create index parameter for registers windows
    --> RTL changed but no functional difference
  • de31bdf [reggen] Remove the devmode input
    --> RTL changed but no functional difference
  • 963a500 [doc] Minor tweak to md sanitisation code
    --> no RTL changed; spec docs changed but changes should be structural only
  • 1b16ca2 [reggen] Add mubi support SWAccess that sets/clears a reg
    --> RTL changed but no functional difference
  • 59f8142 [doc] Moved badges over to using hosted images
    --> no RTL nor specification changed
  • dcd6d22 [SiVal] Test plan updates for HMAC
    --> no RTL nor specification changed
  • a8da331 [doc] hmac registers and interfaces now use CMDGEN
    --> no RTL changed; spec docs changed but changes should be structural only
  • 7688e71 [reggen] Add initial support for version and cip_id hjson fields
    --> no RTL changed
  • fbd888e Revert "[reggen] Add CIP_IDs and bump all major versions"
    --> reverts commit below
  • 0ba10b3 [reggen] Add CIP_IDs and bump all major versions
    --> reverted by commit tabove

Common to all changes:

  • Lint passes.
  • CDC/RDC is not done at block level.
  • Area is being checked as part of Earlgrey-PROD.M2.
  • Timing will be checked later.

Issues closed since the Earlgrey-ES tapeout

https://github.com/lowRISC/opentitan/issues?q=is%3Aissue+is%3Aclosed+closed%3A%3E2023-06-27+hmac

Currently open issues

https://github.com/lowRISC/opentitan/issues?q=is%3Aissue+is%3Aopen+hmac

Summary

Re RTL changes, there were three main sets of changes:

Re closed design issues since Earlgrey-ES tapeout, all D2-relevant changes are captured in the RTL changes above.

Re open design issues, there is only one: #21710 tracked for D3 & M4.

In conclusion, I think this analysis supports signing off hmac version 2.0.0 at D2 (version 1.0.0, which we forked from after Earlgrey-ES TO, was at D3) once the three opens above are done. Since hmac only features the BUS.INTEGRITY countermeasure, I think we can directly sign off at D2S.

@andreaskurth
Copy link
Contributor

@vogelpi: May I ask you for feedback on my analysis and D2S signoff approval -- conditional on the completion of the three opens above -- if you agree?

@andreaskurth andreaskurth changed the title [hmac] D2 Signoff [hmac] D2(S) Signoff Mar 28, 2024
@gdessouky
Copy link
Contributor

Thanks @andreaskurth, I filed another issue now for an open design issue to track for D3 & M4 #22312

@vogelpi
Copy link
Contributor

vogelpi commented Mar 28, 2024

Thanks for preparing this @andreaskurth ! I've reviewed the big RTL PRs as well as the material you've put together and I agree to sign this of at D2S. It's unfortunate that there are still a couple of opens regarding the wider digests and configurable key length feature, including items relevant for D2 (documentation, block diagram). However, this particular change is well motivated and approved by key stakeholders prior to the implementation. So, I believe this is acceptable.

As for the timing checks, the new features are enabled by default and thus also synthesized for FPGA. Timing is still met and the runtime did not horribly increase. So it can be argued that this item of the checklist is met as well.

@gdessouky , I can see that in the PR adding support for wider digests there are about 6 unticked checkboxes (see #21604 (comment)). @andreaskurth noted that issues should be created to track those items. So far, I'v only found the following issues:

The other 3 items which include DIFs etc. seem to be untracked which is not ideal. This might get forgotten. Can you please create issues for these items and link them in the original PR message in #21604? Then it's obvious that all relevant follow-up items are tracked. Thanks!

@gdessouky
Copy link
Contributor

gdessouky commented Mar 29, 2024

Thanks @vogelpi and @andreaskurth!

PR #22247, once merged, would close one of the open issues relevant for D2. It fails CI in ROM tests that don't have to do with HMAC. I've force pushed after Rupert's review, and once you approve it can get merged.

I also put up now PR #22331 to update the documentation modulo the block diagrams (trying right now to find an efficient way to make minor edits to the svg diagrams) as well as the block diagrams. I could elaborate more on the SHA-2 engine and its 32-bit wrapper in the block diagram in a follow-up minor fix. This would close issue #21711.

Regarding the open checkboxes in the PR, the last 3 are covered by issue #22102 (ticked out 1 and consolidated last 2 into 1). I've created another dedicated issue to track the DIFs updates (checkbox 2); I assumed they'd need to be inherently changed anyway for the DV work to proceed at top-level, thanks for catching! I'll link the issues into the PR message.

@andreaskurth
Copy link
Contributor

It's unfortunate that there are still a couple of opens regarding the wider digests and configurable key length feature, including items relevant for D2 (documentation, block diagram). However, this particular change is well motivated and approved by key stakeholders prior to the implementation. So, I believe this is acceptable.

These have now been addressed, and I updated the signoff analysis.

@gdessouky , I can see that in the PR adding support for wider digests there are about 6 unticked checkboxes (see #21604 (comment)). @andreaskurth noted that issues should be created to track those items. So far, I'v only found the following issues:
[...]
The other 3 items which include DIFs etc. seem to be untracked which is not ideal. This might get forgotten. Can you please create issues for these items and link them in the original PR message in #21604? Then it's obvious that all relevant follow-up items are tracked. Thanks!

As mentioned by @gdessouky, two previously untracked items are now complete and the extension of the DIF is tracked in #22332.

With that, I think we're ready to sign HMAC off at D2S. I'll create a PR. Thanks for your review and work on this, @vogelpi and @gdessouky! 👍

andreaskurth added a commit to andreaskurth/opentitan that referenced this issue Mar 29, 2024
See lowRISC#20996 for signoff analysis.  Closes lowRISC#20996.

Signed-off-by: Andreas Kurth <[email protected]>
@vogelpi
Copy link
Contributor

vogelpi commented Mar 29, 2024

This sounds good to me, thanks for the feedback @gdessouky and @andreaskurth , great work!

andreaskurth added a commit that referenced this issue Mar 29, 2024
See #20996 for signoff analysis.  Closes #20996.

Signed-off-by: Andreas Kurth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment