Skip to content

Fix cloop and warnings#1516

Open
Arul-Sujith wants to merge 1 commit into
celabshq:mainfrom
Arul-Sujith:fix-cloop-and-warnings
Open

Fix cloop and warnings#1516
Arul-Sujith wants to merge 1 commit into
celabshq:mainfrom
Arul-Sujith:fix-cloop-and-warnings

Conversation

@Arul-Sujith

@Arul-Sujith Arul-Sujith commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR implements a fix for the cloop! macro's step_by variant as discussed in issue #1504.

Changes

  • The step_by variant of the cloop! macro in both ml-kem and ml-dsa was mathematically incorrect for cases where $start != 0 or $end % $step != 0. This replaces the flawed implementation with a rigorously bounded for loop 0..(($end) / $step + 1) that computes the offset internally. This maintains Eurydice's ability to extract cleanly to C (unlike loop { ... } approaches) while preventing loop bound overshoots and $start scaling bugs.

@Arul-Sujith
Arul-Sujith force-pushed the fix-cloop-and-warnings branch from 1dcc06e to 334182e Compare July 14, 2026 04:27
@Arul-Sujith
Arul-Sujith force-pushed the fix-cloop-and-warnings branch from 334182e to 43f45a6 Compare July 14, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant