Files
papers/lux-lattice-cryptography-primer/sections/10-common-implementation-pitfalls.tex
zeekay abf99d05fc papers: reorganize into per-paper dirs, add Antje Worring as co-author
Restructured from flat .tex/.pdf files into per-paper subdirectories.
Added Antje Worring as co-author on all papers.
Synced PDFs to pdfs/ for download site.
2026-04-18 21:50:07 -07:00

25 lines
1.2 KiB
TeX

\section{Common Implementation Pitfalls}
\begin{enumerate}
\item \textbf{Timing leaks in rejection sampling}: The number of loop iterations in
ML-DSA signing depends on the secret key. Use constant-time comparison and ensure
the loop structure does not leak via timing. Our implementation always performs the
norm check but masks the result.
\item \textbf{Incorrect NTT domain management}: NTT and inverse NTT must be applied in
the right order. Adding polynomials in different domains (one in NTT form, one in
coefficient form) is a common bug. Our type system distinguishes \texttt{Poly} from
\texttt{NTTPoly} at the Go type level.
\item \textbf{Missing modular reduction}: Coefficients must be reduced modulo $q$ after
every arithmetic operation. A single missed reduction can cause subtle correctness
failures that appear only for specific inputs.
\item \textbf{Endianness}: NIST test vectors use little-endian byte encoding for
polynomials. Mixing up endianness produces code that passes self-consistency tests
but fails against reference implementations.
\end{enumerate}
%% ============================================================