Skip to content

Small fixes for SHIFT and KECCAK_ROUND - #1021

Merged
RobinJadoul merged 3 commits into
spec/mainfrom
spec/fixes
Oct 16, 2026
Merged

RobinJadoul merged 3 commits into
spec/mainfrom
spec/fixes

Conversation

@RobinJadoul

Copy link
Copy Markdown
Collaborator
  • Use the SIGN template properly for is_negative in the SHIFT chip
  • Let the keccak round function properly consume the round constants emitted by KECCAK_RC

@RobinJadoul RobinJadoul self-assigned this Oct 15, 2026
@RobinJadoul RobinJadoul added the spec Updates and improvements to the spec document label Oct 15, 2026
@github-actions

Copy link
Copy Markdown

Kimi Code Review

⚠️ Review failed: Kimi API request failed with status 401


Automated review by Kimi (Moonshot AI)

@github-actions

Copy link
Copy Markdown

Codex Code Review

No issues found in the PR diff. The SIGN template correctly forces is_negative to zero for unsigned shifts, and the Keccak lookup multiplicity now balances the round-constant table’s negative multiplicity.

@erik-3milabs erik-3milabs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny rename remark. Applied or not, this PR is gtg!

Comment thread spec/src/shift.toml Outdated
Comment on lines 210 to 214
kind = "interaction"
tag = "MSB16"
input = [["idx", "in", 3]]
kind = "template"
tag = "SIGN"
input = [["idx", "in", 3], "signed"]
output = "is_negative"
multiplicity = "signed"
ref = "shift:c:is_negative_if_signed"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than calling it is_negative, the variable should probably renamed to sign, no? That would be more inline with how we typically call the variable sitting in the output of the SIGN template.

@erik-3milabs erik-3milabs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@RobinJadoul
RobinJadoul merged commit 486edc8 into spec/main Oct 16, 2026
2 checks passed
@RobinJadoul
RobinJadoul deleted the spec/fixes branch October 16, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Updates and improvements to the spec document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants