Public Key Generation
CKKS derives its public key from the RLWE problem. A public key is a pair of polynomials (a, b) over the ring R_q = Z_q[x]/(x^n + 1):
- Sample
auniformly at random inR_q. - Sample a small error
efrom a narrow distribution (e.g., discrete Gaussian). - Let
sbe the secret key (small polynomial). Computeb = e - a · s (mod q).
Security relies on the hardness of recovering s from (a, b); the pair satisfies the RLWE relation b + a · s ≈ e (mod q) with small e.
Minimal Algorithm
a ← Uniform(R_q)e ← Error(σ)withσ > 0b ← e − a · s (mod q)- Output
pk = (a, b)
Notes: choose s and e with small coefficients; record n, q, and σ with the key to ensure compatibility with encryption and evaluation.