[kmac] Handle If `Width` is not integer divisible by `DInWidth`
Nobody has claimed this yet.
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
Description
This is a TODO item from the code.
In keccak_round.sv, DInWidth defines the size of the write chunks, and Width is a function of the Keccak state size. DInWidth is assumed to be a multiple of Width, which is a correct assumption for top_earlygrey. However, we might have an issue with smaller Keccak state sizes, or larger write chunk sizes. Therefore, the TODO asks to update the related code block so that partial chunk writes are allowd.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read hw/ip/kmac/rtl/keccak_round.sv around lines 347-350 and trace how Width and DInWidth determine chunk writes. Update the TODO behavior to allow partial chunks when the widths are not divisible, then verify affected KMAC behavior for smaller Keccak states or larger write chunks.
Written by the indexing model from the issue text.
Assessment
- Domain
- cryptography, embedded-iot
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100