lowRISC / lowRISC/opentitan

[kmac] Handle If `Width` is not integer divisible by `DInWidth`

Open
#18,029 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component:RTL Earlgrey-PROD Triaged Good First Issue IP:kmac Priority:P3 Type:Icebox
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.

https://github.com/lowRISC/opentitan/blob/74854869685ac1063c4365565feda5b7d42af8b7/hw/ip/kmac/rtl/keccak_round.sv#L347-L350

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.