Expand description
Portable CPU backend for the Poulpy lattice cryptography library.
This crate provides two backends for poulpy_hal:
FFT64Portable: scalarf64FFT arithmetic — see thefft64module.NTT4x30Portable: scalar Q120 NTT arithmetic (CRT over four ~30-bit primes) — see thentt4x30module.
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 thepoulpy-coreextension points, soModule<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: impliesenable-coreand adds thepoulpy-ckkslayer.enable-blas: impliesenable-ckksand wires the enabled backends intopoulpy-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-halso 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
referencebackend. - conjugate_
invariant_ test_ suite - Shared invariant ring correctness and cross-backend product tests.
- fft64_
ring_ arith_ ci Fft64RingArithfor a conjugate-invariant backend: DCT transforms and real slots.- fft64_
ring_ arith_ standard Fft64RingArithfor 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
VecZnxBignormalization. - hal_
impl_ vec_ znx_ big_ without_ normalize - HAL
VecZnxBigmethods other than full-width normalization. - hal_
impl_ vec_ znx_ ci - HAL
VecZnxmaps between the conjugate-invariant and standard rings. - hal_
impl_ vec_ znx_ dft - hal_
impl_ vec_ znx_ gadget_ decompose - HAL
VecZnxgadget digit layout, through the portable kernel. - hal_
impl_ vec_ znx_ monomial - HAL
VecZnxmonomial methods (X^k). - hal_
impl_ vec_ znx_ normalize - HAL
VecZnxnormalization methods. - hal_
impl_ vec_ znx_ without_ normalize - HAL
VecZnxmethods excluding normalization. - hal_
impl_ vec_ znx_ without_ normalize_ or_ decompose - HAL
VecZnxmethods 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_stagedover 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
SamplingImplfor a CPU backend with this crate’s hostScalarZnxFillmethods and portable noise kernels, all applied straight to the backend buffer.
Traits§
- Scalar
ZnxFill - Sampling of the secret-key distributions onto a host
ScalarZnxcolumn.
Functions§
- cast_
mut - Reinterprets a
&mut [T]as a&mut [V].
Type Aliases§
- FFT64CI
Portable FFT64Portableover the conjugate invariant ring. The Galois trace serves both rings:- FFT64
Ref Deprecated - The names of this crate’s backends before it was renamed from
poulpy-cpu-ref. - FFT64
Reim Table Deprecated - Former CKKS encoding transform, now
EncodingFFTTable. - NTT4x30CI
Portable NTT4x30Portableover the conjugate invariant ring. Prepared keys retain their backend type:- NTT4x30
Ref Deprecated