-
Notifications
You must be signed in to change notification settings - Fork 781
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,rtl] Handle incomplete message size after cmd.hash_stop #21710
Comments
Indicating an error to SW and letting it handle that may be sufficient. We have to check if HW implements such an error |
@gdessouky: Can SW not simply read the |
Yes, because signaling an error to SW after The more robust way would be to just to block Implementing it in HW should be easy; same way we signal invalid configurations, but covering it in DV would need to wait till beyond M4 I think. Otherwise, a SW implementation will work - @ballifatih, do you see any reason why this can't be checked in the driver implementation? |
This is reasonable. In the current driver implementation, we make sure that HW always receives full blocks and the driver only hits The error reporting discussed here is nice (mainly for debugging and having more robust driver), but I would assign low priority to it. |
Great, so to summarize, we agree this doesn't require HW changes, and can be ensured in the SW driver implementation. Error reporting (from the SW driver) may be added if we see a need for it. |
Perfect. Since this issue is about a potential HW change, which we agreed is not needed, I'm closing it. |
Description
With the PR #21307 merged, HMAC now supports the save & restore feature, where context switching of the HMAC across different SW threads can occur at block size granularity. SW can set the
CMD.hash_stop
bit when the size of the input data provided so far is not yet multiple of block size. HMAC will have to wait until the SW completes the feeding the input data to reach a multiple of block size, and HMAC will hang indefinitely (and thus block the IP for other SW threads), if SW doesn't do that.It will be good to look into we can mitigate this, e.g. we can indicate an error to the SW, where the SW will then have to react by providing the missing data, or/otherwise fill the message buffer with zeros/randomness and discard the result (since hashed message is not the message intended by SW).
@andreaskurth
The text was updated successfully, but these errors were encountered: