Skip to content

Add an NTT/INTT and equivalence tests with OpenFHE#3088

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_930751144
Open

Add an NTT/INTT and equivalence tests with OpenFHE#3088
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_930751144

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Add an NTT/INTT and equivalence tests with OpenFHE

Nb., I am not an expert in NTT/INTT implementations, so I relied heavily on Gemini for the implementation. The equivalence tests should provide some additional certainty about the correctness of the implementation. The benchmark shows that for N=8192, Q=60 bits, this implementation is ~713.0 us, while OpenFHE's implementation is ~188.0 us.

One might ask: why not just use OpenFHE's implementation directly? We could, but at least having a fallback free of any dependencies is probably a good idea.

@copybara-service copybara-service Bot force-pushed the test_930751144 branch 2 times, most recently from 3ecf387 to 8b231d6 Compare June 16, 2026 21:25
@j2kun j2kun requested a review from crockeea June 16, 2026 21:27
@j2kun

j2kun commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

HI @crockeea , with apologies in advance, this is heavily LLM-generated code. But maybe it would suffice for a quick-and-dirty start to enable NTT constant folding in HEIR?

Nb., I am not an expert in NTT/INTT implementations, so I relied heavily on Gemini for the implementation. The equivalence tests should provide some additional certainty about the correctness of the implementation. The benchmark shows that for N=8192, Q=60 bits, this implementation is ~713.0 us, while OpenFHE's implementation is ~188.0 us.

One might ask: why not just use OpenFHE's implementation directly? We could, but at least having a fallback free of any dependencies is probably a good idea.

PiperOrigin-RevId: 930751144
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