Files
papers/lux-fhe-api/sections/05-evaluator-operations.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

57 lines
1.7 KiB
TeX

\section{Evaluator Operations}
\subsection{Boolean Gates}
The evaluator supports standard boolean gates, each followed by automatic bootstrapping:
\begin{table}[h]
\centering
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{Gate} & \textbf{Method} \\
\midrule
AND, OR, XOR, NOT & \texttt{eval.AND(a, b)}, etc. \\
NAND, NOR, XNOR & \texttt{eval.NAND(a, b)}, etc. \\
MUX (ternary select) & \texttt{eval.MUX(cond, a, b)} \\
MAJORITY (2-of-3) & \texttt{eval.MAJORITY(a, b, c)} \\
\bottomrule
\end{tabular}
\caption{Boolean gate API. Each returns \texttt{(*Ciphertext, error)}.}
\label{tab:gates}
\end{table}
\subsection{Integer Operations}
The \texttt{IntegerEvaluator} provides arithmetic and comparison on radix-decomposed encrypted integers:
\begin{table}[h]
\centering
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{Category} & \textbf{Operations} \\
\midrule
Arithmetic & Add, Sub, Mul, Div, Rem, Neg \\
Comparison & Eq, Ne, Lt, Le, Gt, Ge \\
Bitwise & And, Or, Xor, Not, Shl, Shr \\
Selection & Mux (conditional select) \\
Scalar & AddScalar, MulScalar, SubScalar \\
\bottomrule
\end{tabular}
\caption{Integer evaluator operations. All accept \texttt{*RadixCiphertext} arguments.}
\label{tab:int-ops}
\end{table}
\subsection{Error Handling}
Every operation returns an explicit error. Common error conditions:
\begin{itemize}
\item \textbf{Type mismatch}: Attempting to add a \texttt{FheUint8} to a \texttt{FheUint32}. Rejected at the API boundary.
\item \textbf{Nil ciphertext}: Passing an uninitialized ciphertext. Returns \texttt{ErrNilCiphertext}.
\item \textbf{Parameter mismatch}: Evaluating with keys generated for different parameters. Returns \texttt{ErrParamMismatch}.
\end{itemize}
No operation panics. All errors are returned, never swallowed.