TL;DR

A self-contained beginner-level textbook that derives the four mainstream FHE schemes (TFHE, BFV, CKKS, BGV) and their RNS variants from underlying number-theory, lattice-cryptography, and generic GLWE primitives, with an accompanying Python demo library for educational use [Preface, §D-7].

Problem and motivation

The work targets newcomers to FHE who need a single source that bridges the gap from undergraduate number theory and linear algebra to the modern lattice-based homomorphic encryption schemes used for privacy-preserving ML and confidential computing [Preface, p. 1]. The motivating use-case for FHE is privacy-preserving machine learning, where a server processes a client’s data in encrypted form through an ML model and learns neither the input features nor the inference results — only the client decrypts the output with its secret key [Preface, p. 1]. Additional motivating applications listed are confidential blockchain / smart contracts, secure outsourced analytics, encrypted database queries, privacy-preserving search, and FHE-assisted multi-party digital signatures [Preface, p. 1]. No threat model is formalised — the threat model is implicit in the underlying LWE/RLWE hardness assumptions developed in Part II [§B-1].

Key contributions

FHE setup

ML setup

Datasets

Dataset Task Size (train/test) Modality Notes
N/A N/A N/A N/A Textbook — no empirical datasets are used; worked examples are small symbolic / numeric toy inputs (e.g., polynomial coefficients, integer vectors) [throughout].

Pipeline diagram

End-to-end ciphertext flow as described in the Preface and the neural-networks bootstrapping subsection [Preface; §D-1.8.11].

flowchart LR
    subgraph Client
        A[Plaintext input] --> B[Encrypt with sk]
    end
    subgraph Server
        C[Homomorphic ops] --> D[Bootstrap if needed]
        D --> C
    end
    subgraph Client_dec [Client]
        E[Decrypt with sk] --> F[Plaintext result]
    end
    B -. ciphertext .-> C
    D -. ciphertext .-> E

Pipeline steps (text)

  1. Client encrypts the input under the secret key using one of TFHE / BFV / CKKS / BGV [Preface, p. 1].
  2. Server runs homomorphic additions and multiplications on the ciphertext (ciphertext-to-ciphertext or ciphertext-to-plaintext), optionally invoking modulus switching, key switching, and rotation primitives [§C-1 to §C-5].
  3. Server invokes scheme-specific bootstrapping whenever the noise budget or modulus chain is exhausted, refreshing the ciphertext for further computation [§D-1.8, §D-2.11, §D-3.13, §D-4.11].
  4. Server returns the resulting ciphertext to the client [Preface, p. 1].
  5. Client decrypts with the secret key and recovers the plaintext result [Preface, p. 1; §D-6 Table 16].

Architecture diagram

Topical (chapter-level) structure of the textbook itself, since there is no trained ML architecture.

flowchart LR
    I([Part I: Basic Math]) --> II([Part II: Post-quantum Crypto])
    II --> III([Part III: Generic FHE])
    III --> IV([Part IV: FHE Schemes])
    II --> LWE[LWE / RLWE / GLWE]
    II --> GLEV[GLev / GGSW]
    III --> GADD[GLWE Add]
    III --> GMUL[GLWE Mul]
    III --> GMS[Modulus Switch]
    III --> GKS[Key Switch]
    IV --> TFHE[TFHE]
    IV --> BFV[BFV]
    IV --> CKKS[CKKS]
    IV --> BGV[BGV]
    IV --> RNS[RNS variants]
    TFHE --> NN[NN Bootstrapping]

Results

No empirical results — the textbook contains derivations, worked numeric toy examples, and a side-by-side analytical comparison of the four schemes [§D-6, Tables 7-17].

Metric This paper Baseline Hardware
Accuracy N/A N/A N/A
Latency / throughput N/A N/A N/A
Ciphertext size N/A N/A N/A

The substantive cross-scheme comparison is qualitative: hard-problem basis (TFHE = LWE; BFV / CKKS / BGV = RLWE), unit data type (TFHE = vector; others = polynomial), plaintext spaces, ciphertext layout, scaling-factor placement, encryption / decryption formulas, ciphertext-modulus structure (single q for TFHE / BFV; L-level modulus chain for CKKS / BGV), and bootstrapping mechanism [§D-6, Tables 7-17].

Limitations and assumptions

Not applicable in the empirical sense. The textbook positions itself relative to prior tutorial / reference material via its reference list, including Joye’s “Guide to FHE over the Discretized Torus” [Ref 11], the Zama TFHE Deep Dive series by Chillotti [Refs 7-10], Fan-Vercauteren’s somewhat-practical FHE paper [Ref 13], Geelen-Vercauteren bootstrapping for BGV/BFV [Ref 14], Halevi-Shoup HElib bootstrapping [Ref 15], Cheon et al. CKKS bootstrapping [Ref 18], the RNS-CKKS variant [Ref 26], and the full RNS variant of FV / BFV by Bajard et al. [Ref 24] [§References, pp. 256-257].

Code and artifacts

Python demo FHE library covering TFHE, BFV, CKKS, BGV for educational purposes — https://github.com/fhetextbook/fhe-textbook [§D-7, p. 255]. License not stated in the textbook text.

Extra diagrams (optional)

Threat model

Not formalised — only the general FHE client / server pattern is described in the Preface [Preface, p. 1].

flowchart LR
    C[Client] -- enc(x) --> S[Server]
    S -- enc(y) --> C

Federated round

Not applicable.

Activation approximation

The textbook does not introduce a new polynomial activation. It does cover the two general tools (Taylor series [§A-14], Lagrange polynomial interpolation [§A-15]) used to derive polynomial approximations of non-linear functions, and it notes that TFHE programmable bootstrapping can directly evaluate arbitrary functions including ReLU / sigmoid / sin / tanh [§D-1.8.11, p. 130].

Open questions