mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
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.
27 lines
837 B
TeX
27 lines
837 B
TeX
\section{Encryption and Decryption}
|
|
|
|
|
|
\subsection{Boolean Encryption}
|
|
|
|
Single-bit encryption produces an LWE ciphertext:
|
|
|
|
\begin{lstlisting}[language=Go]
|
|
ct, err := enc.EncryptBit(true)
|
|
bit, err := dec.DecryptBit(ct)
|
|
// bit == true
|
|
\end{lstlisting}
|
|
|
|
\subsection{Integer Encryption}
|
|
|
|
Integers are decomposed into radix blocks, each block being a \texttt{ShortInt} (1--4 bits) encrypted in a single LWE ciphertext:
|
|
|
|
\begin{lstlisting}[language=Go]
|
|
intEnc := fhe.NewIntegerEncryptor(params, sk)
|
|
ct, err := intEnc.EncryptUint32(42)
|
|
val, err := intEnc.DecryptUint32(ct)
|
|
// val == 42
|
|
\end{lstlisting}
|
|
|
|
The \texttt{RadixCiphertext} type carries metadata about its FHE type (\texttt{FheUint8}, \texttt{FheUint16}, \texttt{FheUint32}, \texttt{FheUint64}, \texttt{FheUint128}, \texttt{FheUint256}) and enforces type matching at the API boundary.
|
|
|