Skip to content

Commit e84223c

Browse files
nindanaotoclaude
andcommitted
Add lvl3param case to TwistFFTAdd for __uint128_t support
TwistFFTAdd was introduced in commit 2b15dde to fuse backward FFT with accumulation in CMUX, but the lvl3param branch (used by Double Decomposition with __uint128_t) was not included. This caused a static_assert failure when compiling gatebootstrappingtlwe2tlwedoubledecomposition. Mirrors TwistFFT's lvl3param handling: compute via a temp uint64_t array using fftplvl3, then accumulate (+=) into the 128-bit result. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f47d4df commit e84223c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/mulfft.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ inline void TwistFFTAdd(Polynomial<P> &res, PolynomialInFD<P> &a)
120120
else if constexpr (std::is_same_v<typename P::T, uint64_t>)
121121
fftplvl1.execute_direct_torus64_add(res.data(), a.data());
122122
}
123+
else if constexpr (std::is_same_v<P, lvl3param>) {
124+
alignas(64) std::array<uint64_t, P::n> temp;
125+
fftplvl3.execute_direct_torus64(temp.data(), a.data());
126+
for (int i = 0; i < P::n; i++)
127+
res[i] += static_cast<__uint128_t>(temp[i]);
128+
}
123129
else if constexpr (std::is_same_v<typename P::T, uint64_t>)
124130
fftplvl2.execute_direct_torus64_add(res.data(), a.data());
125131
else

0 commit comments

Comments
 (0)