Skip to content

spec: Fix KECCAK#554

Merged
erik-3milabs merged 9 commits into
spec/mainfrom
spec/fix_keccak
May 5, 2026
Merged

spec: Fix KECCAK#554
erik-3milabs merged 9 commits into
spec/mainfrom
spec/fix_keccak

Conversation

@erik-3milabs
Copy link
Copy Markdown
Collaborator

Fixes two mistakes in the KECCAK chip spec:

  1. off-by-one indexing errors for cyclic shifts,
  2. ordering mistake constructing ECALL numbers.

Closes #546

@erik-3milabs erik-3milabs self-assigned this Apr 24, 2026
@erik-3milabs erik-3milabs added bug Something isn't working spec Updates and improvements to the spec document labels Apr 24, 2026
@erik-3milabs erik-3milabs linked an issue Apr 24, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

Codex Code Review

No findings in the PR diff.

The changes look like targeted spec fixes: SHA256/KECCAK now use the documented 64-bit two’s-complement ECALL IDs (-1/-2), and the keccak_round index adjustments are consistent with HWSL operating on 16-bit halfwords rather than 8-bit byte offsets. I wasn’t able to run cargo test here because rustup failed creating temp files on a read-only path, so this is a static review only.

Comment thread spec/src/keccak_round.toml Outdated
Comment thread spec/src/keccak_round.toml Outdated
rot_left and rot_right contain 96 constant zero-columns, which can be dropped. Additionally, those zeroes do not have to be byte-checked.
Comment thread spec/src/keccak_round.toml Outdated
Comment thread spec/keccak.typ
Comment thread spec/src/keccak_round.toml Outdated
@erik-3milabs erik-3milabs merged commit 2e05a25 into spec/main May 5, 2026
2 checks passed
@erik-3milabs erik-3milabs deleted the spec/fix_keccak branch May 5, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working spec Updates and improvements to the spec document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keccak spec mismatches affecting verification

2 participants