Files
papers/gpu-evm-whitepaper/sections/05-post-quantum-cryptography-acceleration.tex

101 lines
4.5 KiB
TeX

\section{Post-Quantum Cryptography Acceleration}
\label{sec:pq}
%% ============================================================================
\subsection{The NTT Primitive}
The Number Theoretic Transform (NTT) is the computational core shared by all lattice-based
cryptographic algorithms. NTT converts polynomial multiplication from $O(n^2)$ to
$O(n \log n)$, and its structure---independent butterfly operations at each stage---maps
naturally to GPU parallel execution.
cevm implements NTT as the foundational GPU primitive, with 6 shader variants optimized
for different parameter sets:
\begin{table}[h]
\centering
\small
\begin{tabular}{lll}
\toprule
\textbf{NTT Variant} & \textbf{Used By} & \textbf{Parameters} \\
\midrule
\texttt{ntt\_base} & All & Generic radix-2 butterfly \\
\texttt{ntt\_dilithium} & ML-DSA & $q = 8380417$, $n = 256$ \\
\texttt{ntt\_kyber} & ML-KEM & $q = 3329$, $n = 256$ \\
\texttt{ntt\_tfhe} & FHE & Large $n$ (1024--32768) \\
\texttt{ntt\_merged} & Batch ops & Fused forward+inverse \\
\texttt{ntt\_stockham} & All & Auto-sort variant \\
\bottomrule
\end{tabular}
\caption{NTT shader variants. Each is optimized for the modulus and degree of its
target algorithm. The \texttt{twiddle\_cache} shader pre-computes roots of unity.}
\label{tab:ntt}
\end{table}
\subsection{NIST FIPS Algorithms on GPU}
cevm implements all three NIST post-quantum FIPS standards as Metal compute shaders:
\begin{itemize}
\item \textbf{ML-DSA} (\texttt{mldsa} shader): FIPS 204. Lattice-based digital signatures
(formerly ML-DSA (FIPS 204, formerly CRYSTALS-Dilithium)). Used for transaction signing in Lux's post-quantum mode.
Core operation: NTT-based polynomial multiplication over $\mathbb{Z}_q[x]/(x^{256}+1)$.
\item \textbf{ML-KEM} (\texttt{mlkem} shader): FIPS 203. Lattice-based key encapsulation
(formerly ML-KEM (FIPS 203, formerly CRYSTALS-Kyber)). Used for encrypted peer-to-peer communication in Lux's
network layer. Core operation: NTT-based polynomial arithmetic with noise sampling.
\item \textbf{SLH-DSA} (\texttt{slhdsa} shader): FIPS 205. Hash-based stateless signatures
(formerly SLH-DSA (FIPS 205, formerly SPHINCS+)). Used as a fallback signature scheme---relies only on hash function
security, providing defense-in-depth against lattice cryptanalysis breakthroughs.
\end{itemize}
\subsection{Lux-Specific Protocols}
\begin{itemize}
\item \textbf{Pulsar} (\texttt{corona} shader): Lux's custom post-quantum signature
scheme optimized for blockchain consensus. Ring-based construction with smaller
signatures than ML-DSA at equivalent security levels.
\item \textbf{FROST} (\texttt{frost} shader): Flexible Round-Optimized Schnorr Threshold
signatures. GPU-accelerated for validator committee signing in Quasar consensus.
\item \textbf{CGGMP21} (\texttt{cggmp21} shader): Threshold ECDSA protocol for
backward-compatible multi-party signing. GPU acceleration of the MtA
(Multiplicative-to-Additive) share conversion step.
\end{itemize}
\subsection{Precompile GPU Acceleration}
12 of 18 Lux EVM precompiles are now GPU-accelerated:
\begin{table}[h]
\centering
\small
\begin{tabular}{lll}
\toprule
\textbf{Precompile} & \textbf{Status} & \textbf{Notes} \\
\midrule
\texttt{mldsa} & GPU-accelerated & Already wired (FIPS 204) \\
\texttt{mlkem} & GPU-accelerated & Already wired (FIPS 203) \\
\texttt{zk} & GPU-accelerated & Already wired (zero-knowledge proofs) \\
\texttt{threshold} & GPU-accelerated & Already wired (threshold signatures) \\
\texttt{ed25519} & GPU-accelerated & New: EdDSA curve operations \\
\texttt{sr25519} & GPU-accelerated & New: Schnorr-Ristretto signatures \\
\texttt{slhdsa} & GPU-accelerated & New: FIPS 205 hash-based signatures \\
\texttt{frost} & GPU-accelerated & New: threshold Schnorr (Quasar consensus) \\
\texttt{cggmp21} & GPU-accelerated & New: threshold ECDSA (MtA on GPU) \\
\texttt{corona} & GPU-accelerated & New: Lux PQ ring signatures \\
\texttt{blake3} & GPU-accelerated & New: BLAKE3 hash function \\
\texttt{fhe} & GPU-accelerated & New: TFHE blind rotation \\
\bottomrule
\end{tabular}
\caption{GPU-accelerated EVM precompiles. 12 of 18 total precompiles now execute on GPU.
The remaining 6 are standard Ethereum precompiles (ecrecover, SHA-256, RIPEMD-160,
identity, modexp, ecAdd/ecMul/ecPairing) scheduled for subsequent GPU porting.}
\label{tab:precompiles}
\end{table}
%% ============================================================================