Skip to main content

Crate poulpy_cpu_portable

Crate poulpy_cpu_portable 

Source
Expand description

Portable CPU backend for the Poulpy lattice cryptography library.

This crate provides two backends for poulpy_hal:

Both are portable across all CPU architectures, in plain Rust (std::simd for normalization), and their scalar kernels, in kernels, back the SIMD backends too.

Both are generic over the ring, standard by default: FFT64CIPortable and NTT4x30CIPortable are their conjugate invariant instantiations.

§Features

The crate implements the poulpy_hal extension points unconditionally. The higher layers are opt-in:

  • enable-core: implements the poulpy-core extension points, so Module<FFT64Portable> / Module<NTT4x30Portable> gain the scheme-level traits (GLWEKeyswitch, Automorphism, …). Without it those traits do not resolve, and the failure reads as a missing impl rather than a missing feature. Required to use this crate on either side of a cross-backend comparison.
  • enable-ckks: implies enable-core and adds the poulpy-ckks layer.
  • enable-blas: implies enable-ckks and wires the enabled backends into poulpy-blas.

§Platform support

Compiles and runs on any target supported by the Rust standard library. No platform-specific intrinsics or assembly are used.

Re-exports§

pub use fft64::FFT64Portable;
pub use ntt4x30::NTT4x30Portable;
pub use ntt4x30::NTT4x30PortableHandle;

Modules§

api
capabilities
Reporting which backends a machine can run.
ckks_encoding
CPU implementation of the CKKS slot-encoding extension point.
ckks_paco
Reference implementation of the PaCo coefficient encoding (CKKSPaCoCoeffEncodingImpl).
ckks_ship
Reference implementation of the SHIP coefficient encoding (CKKSShipCoeffEncodingImpl).
fft64
Portable (scalar f64 FFT) backend for the Poulpy lattice cryptography library.
hal_defaults
kernels
Portable production implementations of polynomial operations.
layouts
ntt4x30
Portable NTT4x30 CPU backend for the Poulpy lattice cryptography library.
source
table_cache
Compatibility re-exports for the module plan cache, which now lives in poulpy-hal so CPU and future device backends share the same neutral ownership contract.
test_suite
Kernel parity tests shared by CPU backend crates.

Macros§

conjugate_invariant_core_test_suite
Core operation parity under an invariant module configuration, against the explicitly selected reference backend.
conjugate_invariant_test_suite
Shared invariant ring correctness and cross-backend product tests.
fft64_ring_arith_ci
Fft64RingArith for a conjugate-invariant backend: DCT transforms and real slots.
fft64_ring_arith_standard
Fft64RingArith for a standard-ring backend: negacyclic FFT and complex slots.
hal_impl_cnv
hal_impl_module
hal_impl_svp
hal_impl_vec_znx
hal_impl_vec_znx_big
hal_impl_vec_znx_big_normalize
Full-width HAL VecZnxBig normalization.
hal_impl_vec_znx_big_without_normalize
HAL VecZnxBig methods other than full-width normalization.
hal_impl_vec_znx_ci
HAL VecZnx maps between the conjugate-invariant and standard rings.
hal_impl_vec_znx_dft
hal_impl_vec_znx_gadget_decompose
HAL VecZnx gadget digit layout, through the portable kernel.
hal_impl_vec_znx_monomial
HAL VecZnx monomial methods (X^k).
hal_impl_vec_znx_normalize
HAL VecZnx normalization methods.
hal_impl_vec_znx_without_normalize
HAL VecZnx methods excluding normalization.
hal_impl_vec_znx_without_normalize_or_decompose
HAL VecZnx methods excluding normalization and the gadget digit layout, for a backend that provides both.
hal_impl_vmp
impl_ckks_encoding
Instantiates the generic CKKS encoder for a backend.
impl_ckks_paco_coeff_encoding
Opts a CPU backend into the reference PaCo coefficient encoding: the staged scheme routine paco_coeff_encodings_staged over the backend’s CKKS encoding operations. Requires the backend’s CKKS encoding implementation.
impl_ckks_ship_coeff_encoding
Opts a CPU backend into the reference SHIP coefficient encoding. Requires the backend’s CKKS encoding implementation.
impl_cpu_ckks_defaults
Registers the CKKS families shared by both rings (impl_ckks_reference_full!), with encoding, for a CPU backend. The backend selects its encoding transform separately; standard backends also register the standard-only families.
impl_cpu_core_defaults
Registers shared Core defaults and host sampling for a CPU backend. Tensoring and strided digit products are registered separately to allow optimized kernels.
impl_sampling_host
Implements SamplingImpl for a CPU backend with this crate’s host ScalarZnxFill methods and portable noise kernels, all applied straight to the backend buffer.

Traits§

ScalarZnxFill
Sampling of the secret-key distributions onto a host ScalarZnx column.

Functions§

cast_mut
Reinterprets a &mut [T] as a &mut [V].

Type Aliases§

FFT64CIPortable
FFT64Portable over the conjugate invariant ring. The Galois trace serves both rings:
FFT64RefDeprecated
The names of this crate’s backends before it was renamed from poulpy-cpu-ref.
FFT64ReimTableDeprecated
Former CKKS encoding transform, now EncodingFFTTable.
NTT4x30CIPortable
NTT4x30Portable over the conjugate invariant ring. Prepared keys retain their backend type:
NTT4x30RefDeprecated