Skip to content

Refactor NTT butterfly iterations & remove redundant input arrays#172

Closed
doran2728 wants to merge 7 commits intoVerified-zkEVM:masterfrom
erdkocak:ntt_fixes
Closed

Refactor NTT butterfly iterations & remove redundant input arrays#172
doran2728 wants to merge 7 commits intoVerified-zkEVM:masterfrom
erdkocak:ntt_fixes

Conversation

@doran2728
Copy link

Summary

Targeted performance and structural optimizations to the core NTT module.

Changes

Redundant Array Cleanup (Domain.lean, Forward.lean)

  • Removed inputArray, zeroPad, and pad helper functions
  • The forward pipeline now evaluates directly on raw polynomials without an intermediate array copy

Butterfly Iteration Refactor (Forward.lean, Inverse.lean)

  • Rewrote the Cooley-Tukey butterflyStage outer loop in both the forward and inverse transforms
  • Before: for base in [0:D.n] with an inner if base % blockSize == 0 guard
  • After: for block in [0:D.n / blockSize] with base := block * blockSize
  • This direct block iteration eliminates redundant modulo checks, yields faster wall-clock execution, and significantly simplifies the upcoming formal correctness proofs

@doran2728
Copy link
Author

Apologies, wrong repo again :(

@doran2728 doran2728 closed this Mar 21, 2026
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.

2 participants