Skip to main content

Crate poulpy_ckks

Crate poulpy_ckks 

Source
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 factor
  • log_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

ModuleRole
encodingCKKS encoders/decoders, including slot-wise real/imaginary packing
layoutsCKKS ciphertext/plaintext wrappers and metadata-aware allocation helpers
leveledLeveled arithmetic (add, sub, mul, neg, rotate, conjugate), encryption, decryption, and rescale
bootstrappingPlanned 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 mirror poulpy-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§

CKKSMeta
CKKS semantic precision metadata carried by ciphertexts and plaintexts.

Enums§

CKKSCompositionError
CKKS composition and alignment errors returned by high-level operations.

Traits§

CKKSCtBounds
Marker bound for CKKS ciphertext type parameters.
CKKSInfos
Common metadata accessors for CKKS ciphertext and plaintext containers.
CKKSPlaintextToBackendRef
SetCKKSInfos
Mutable CKKS metadata access for ciphertext/plaintext containers.

Type Aliases§

CKKSCiphertextMut
CKKSCiphertextRef