-
Notifications
You must be signed in to change notification settings - Fork 815
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
[prim_sha2_pad, hmac] Don't allow skipping the padding after stopping a hash operation #23936
Comments
For more details, please refer to this comment. |
This commit removes a conditional FSM state transition that was deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. It made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. As a side-effect, the removal plugs some existing FSM transition coverage holes in `prim_sha2_pad` whose manual exclusions can be removed as well. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes a conditional FSM state transition that was deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. It made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. As a side-effect, the removal plugs some existing FSM transition coverage holes in `prim_sha2_pad` whose manual exclusions can be removed as well. Removing the conditional makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. The FSM will still correctly move from `StIdle` to `StFifoReceive` as it already checks the same conditional inside its state logic whereas for `StFifoReceive` it had no effect. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. It made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. As a side-effect, the removal plugs some existing FSM transition coverage holes in `prim_sha2_pad` whose manual exclusions can be removed as well. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. It made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. As a side-effect, the removal plugs some existing FSM transition coverage holes in `prim_sha2_pad` whose manual exclusions can be removed as well. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. It made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. As a side-effect, the removal plugs some existing FSM transition coverage holes in `prim_sha2_pad` whose manual exclusions can be removed as well. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. They made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes the coverage exclusions that were introduced as part of the padding cancellation bug lowRISC#23936 that was fixed in the previous commit. New exclusions are added that cover some impossible conditions and branches as identified in lowRISC#24692. Signed-off-by: Andrea Caforio <[email protected]> Co-authored-by: Martin Velay <[email protected]>
This commit removes the coverage exclusions that were introduced as part of the padding cancellation bug lowRISC#23936 that was fixed in the previous commit. New exclusions are added that cover some impossible conditions and branches as identified in lowRISC#24692. Signed-off-by: Andrea Caforio <[email protected]> Co-authored-by: Martin Velay <[email protected]>
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. They made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. They made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see #23936. They made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
PR #25590 which removes these undesirable FSM transitions has been merged into PR #25696 will remove the corresponding coverage exclusions on For |
This commit removes some conditional FSM states transition that were deemed undesirable in `prim_sha2_pad`, see lowRISC#23936. They made it possible to cancel an ongoing padding operation, which is disallowed by the HMAC module. This change makes it impossible to transition into the `StFifoReceive` state from either `StPad80`, `StPad00`, `StLenHi` or `StLenLo` by asserting the `hash_go` signal. Signed-off-by: Andrea Caforio <[email protected]>
Description
During coverage closure for V2S, @martin-velay and @gdessouky noted that there are some uncovered FSM transitions inside
prim_sha2_pad
:An inspection of the RTL reveals that these transtions can be covered by something like the following sequence:
prim_sha2_pad
go into any theStPad80
/StPad00
/StLenHi
/StLenLo
states. As a result of thiscfg_block
will assert and any futurereg_hash_start
/reg_hash_continue
won't be forwarded toprim_sha2_pad
.reg_hash_stop
. This will makecfg_block
go low again in the next clock cycle.reg_hash_start
/reg_hash_continue
. This will trigger the uncovered transition.The problematic thing with this is that after Step 2, the design should finish the hashing and then append the padding. By triggering another
reg_hash_start
orreg_hash_continue
, software can cause the hardware to abort the padding and restart the hashing. This is not intended behavior, but software is also not expected to start another operation directly after stopping one. Instead, software is expected to wait for thehmac_done
interrupt or to poll the status register to wait for the hashing and padding to finish before triggering further operations as outlined in the HMAC programmer's guide .@andreaskurth and I concluded that this is NOT a terrible bug for Earlgrey-PROD and we will exclude the missing / buggy transitions from FSM coverage. But we should still fix this in a future release. The FSM should only be able to go back into the
StFifoReceive
state after finishing the padding.The text was updated successfully, but these errors were encountered: