Expand description
§poulpy-ckks
Backend-agnostic implementation of the CKKS (Cheon-Kim-Kim-Song)
homomorphic encryption scheme, built on top of the low-level primitives
provided by poulpy-core, poulpy-hal, and the available compute
backends (poulpy-cpu-ref, poulpy-cpu-avx).
The crate uses a bivariate polynomial representation over the Torus
(base-2^{base2k} digits) instead of the RNS representation used by
most other CKKS libraries. Public precision management is exposed through
CKKSMeta:
log_delta: base-2 logarithm of the encoded plaintext scaling factorlog_budget: remaining homomorphic headroom, also tracked in bits
Together they define the semantic torus width of a value:
effective_k() = log_delta + log_budget.
Storage is rounded up to the next multiple of base2k, so the allocated
width max_k() may exceed effective_k(). Arithmetic APIs update this
metadata for you, while maintenance helpers let you compact or resize owned
buffers without violating those invariants.
Safe add/sub operations return K-normalized ciphertexts. The paired
unnormalized traits (api::CKKSAddOpsUnnormalized and
api::CKKSSubOpsUnnormalized) write into an
layouts::UnnormalizedCKKSCiphertext for callers who want to fuse
several linear steps before normalizing explicitly. Limb digits in that
wrapper may hold un-propagated carries (wider than base2k bits), so
passing it to any DFT-domain primitive (keyswitching, convolution,
automorphisms) would produce incorrect decryptions. The wrapper does not
implement GLWEToBackendRef or GLWEToBackendMut, making such misuse
a compile error. Call layouts::UnnormalizedCKKSCiphertext::normalize
before the next keyswitching or convolution step.
§Modules
| Module | Role |
|---|---|
encoding | CKKS encoders/decoders, including slot-wise real/imaginary packing |
layouts | CKKS ciphertext/plaintext wrappers and metadata-aware allocation helpers |
leveled | Leveled arithmetic (add, sub, mul, neg, rotate, conjugate), encryption, decryption, and rescale |
| bootstrapping | Planned CKKS bootstrapping |
Modules§
- api
- default
- encoding
- CKKS encoding helpers.
- layouts
- CKKS-level data structures.
- leveled
- Re-export shim that preserves the historical
crate::leveled::api::*import paths from before the crate was reorganised to mirrorpoulpy-core. - oep
- test_
suite - Backend-generic CKKS test suite.
Macros§
- ckks_
backend_ test_ suite - impl_
ckks_ add_ defaults - impl_
ckks_ conjugate_ defaults - impl_
ckks_ copy_ defaults - impl_
ckks_ encryption_ defaults - impl_
ckks_ imag_ defaults - impl_
ckks_ maintain_ ops_ defaults - impl_
ckks_ mul_ defaults - impl_
ckks_ neg_ defaults - impl_
ckks_ plaintext_ defaults - impl_
ckks_ pow2_ defaults - impl_
ckks_ rescale_ defaults - impl_
ckks_ rotate_ default - impl_
ckks_ sub_ defaults
Structs§
- CKKS
Meta - CKKS semantic precision metadata carried by ciphertexts and plaintexts.
Enums§
- CKKS
Composition Error - CKKS composition and alignment errors returned by high-level operations.
Traits§
- CKKS
CtBounds - Marker bound for CKKS ciphertext type parameters.
- CKKS
Infos - Common metadata accessors for CKKS ciphertext and plaintext containers.
- CKKS
Plaintext ToBackend Ref - SetCKKS
Infos - Mutable CKKS metadata access for ciphertext/plaintext containers.