Skip to main content

Module api

Module api 

Source

Traits§

CnvPVecAlloc
Allocates prepared convolution operands (CnvPVecL, CnvPVecR).
CnvPVecBytesOf
Returns the byte sizes for prepared convolution operands.
Convolution
Bivariate convolution over Z[X, Y] mod (X^N + 1) where Y = 2^{-K}.
HostBufMut
Host-visible borrowed scratch region for a backend.
MatZnxAlloc
Allocates backend-owned MatZnx layouts.
ModuleLogN
Query log2(N) with a default implementation derived from ModuleN::n.
ModuleN
Query the ring degree N of a Module.
ModuleNew
Instantiate a new crate::layouts::Module.
NegacyclicFFT
Abstract precomputed table for the negacyclic (reim) FFT and its inverse.
NegacyclicFFTNew
Extension of NegacyclicFFT that also provides a constructor.
ScalarZnxAlloc
Allocates backend-owned ScalarZnx layouts.
ScalarZnxFillBinaryBlockBackend
ScalarZnxFillBinaryBlockSourceBackend
ScalarZnxFillBinaryHwBackend
ScalarZnxFillBinaryHwSourceBackend
ScalarZnxFillBinaryProbBackend
ScalarZnxFillBinaryProbSourceBackend
ScalarZnxFillTernaryHwBackend
ScalarZnxFillTernaryHwSourceBackend
ScalarZnxFillTernaryProbBackend
ScalarZnxFillTernaryProbSourceBackend
ScratchArenaTakeBasic
Backend-native arena allocation of typed HAL layouts.
ScratchAvailable
Returns how many bytes left can be taken from the scratch.
ScratchOwnedAlloc
Allocates a new crate::layouts::ScratchOwned of size aligned bytes.
ScratchOwnedBorrow
Borrows an owned scratch buffer as a backend-native arena.
SvpApplyDft
Apply a scalar-vector product between a[a_col] and b[b_col] and stores the result on res[res_col].
SvpApplyDftToDft
Apply a scalar-vector product between a[a_col] and b[b_col] and stores the result on res[res_col].
SvpApplyDftToDftAssign
Apply a scalar-vector product between res[res_col] and a[a_col] and stores the result on res[res_col].
SvpPPolAlloc
Allocates as crate::layouts::SvpPPol.
SvpPPolBytesOf
Returns the size in bytes to allocate a crate::layouts::SvpPPol.
SvpPPolCopyBackend
Copy one prepared scalar polynomial column into another.
SvpPrepare
Prepare a crate::layouts::ScalarZnx into an crate::layouts::SvpPPol.
VecZnxAddAssignBackend
VecZnxAddConstAssignBackend
VecZnxAddConstIntoBackend
VecZnxAddIntoBackend
VecZnxAddNormalBackend
VecZnxAddNormalSourceBackend
VecZnxAddScalarAssignBackend
VecZnxAddScalarIntoBackend
VecZnxAlloc
Allocates backend-owned VecZnx layouts.
VecZnxAutomorphismAssignBackend
VecZnxAutomorphismAssignTmpBytes
VecZnxAutomorphismBackend
VecZnxBigAddAssign
VecZnxBigAddInto
VecZnxBigAddNormal
Add a discrete normal distribution on res.
VecZnxBigAddNormalBackend
VecZnxBigAddSmallAssign
VecZnxBigAddSmallIntoBackend
VecZnxBigAlloc
Allocates as crate::layouts::VecZnxBig.
VecZnxBigAutomorphism
VecZnxBigAutomorphismAssign
VecZnxBigAutomorphismAssignTmpBytes
Returns scratch bytes required for in-place automorphism on VecZnxBig.
VecZnxBigBytesOf
Returns the size in bytes to allocate a crate::layouts::VecZnxBig.
VecZnxBigFromBytes
Consume a vector of bytes into a crate::layouts::VecZnxBig. User must ensure that bytes is memory aligned and that its length is equal to VecZnxBigBytesOf::bytes_of_vec_znx_big.
VecZnxBigFromSmallBackend
Converts a coefficient-domain VecZnx column into a VecZnxBig column.
VecZnxBigInnerSumBackend
Sums coefficients from a selected VecZnxBig column and stores each limb’s result in one destination coefficient.
VecZnxBigNegate
Negates the selected column of a and stores the result in res.
VecZnxBigNegateAssign
Negates the selected column of res in-place.
VecZnxBigNormalize
Normalizes a VecZnxBig into a coefficient-domain VecZnx with the target base and offset.
VecZnxBigNormalizeTmpBytes
Returns scratch bytes required for VecZnxBigNormalize.
VecZnxBigSub
VecZnxBigSubAssign
VecZnxBigSubNegateAssign
VecZnxBigSubSmallABackend
VecZnxBigSubSmallAssign
VecZnxBigSubSmallBBackend
VecZnxBigSubSmallNegateAssign
VecZnxCopyBackend
VecZnxCopyRangeBackend
VecZnxDftAddAssign
In-place addition in DFT domain: res += a.
VecZnxDftAddInto
Element-wise addition of two VecZnxDft vectors.
VecZnxDftAddScaledAssign
In-place scaled addition in DFT domain: res += a * a_scale.
VecZnxDftAlloc
Allocates a VecZnxDft.
VecZnxDftApply
Applies the forward DFT to a coefficient-domain VecZnx, storing the result in a VecZnxDft.
VecZnxDftBytesOf
Returns the byte size required for a VecZnxDft.
VecZnxDftCopy
Copies selected limbs from one VecZnxDft to another.
VecZnxDftFromBytes
Wraps a byte buffer into a VecZnxDft.
VecZnxDftSub
Element-wise subtraction of two VecZnxDft vectors.
VecZnxDftSubAssign
In-place subtraction in DFT domain: res -= a.
VecZnxDftSubNegateAssign
In-place negated subtraction in DFT domain: res = a - res.
VecZnxDftZero
Zeroes all limbs of the selected column in DFT domain.
VecZnxExtractCoeffBackend
VecZnxFillNormalBackend
VecZnxFillNormalSourceBackend
Fills the selected column with a discrete Gaussian noise vector scaled by 2^{-k} with standard deviation sigma, bounded to [-bound, bound].
VecZnxFillUniformBackend
VecZnxFillUniformSourceBackend
VecZnxHadamardProductScalarZnxBackend
VecZnxIdftApply
Applies the inverse DFT, converting a VecZnxDft into a VecZnxBig (extended precision).
VecZnxIdftApplyTmpA
Inverse DFT using a as temporary storage (avoids extra scratch).
VecZnxIdftApplyTmpBytes
Returns scratch bytes required for VecZnxIdftApply.
VecZnxLshAddCoeffIntoBackend
VecZnxLshAddIntoBackend
VecZnxLshAssignBackend
VecZnxLshBackend
VecZnxLshCoeffBackend
VecZnxLshSubBackend
VecZnxLshTmpBytes
Returns scratch bytes required for left-shift operations.
VecZnxMergeRingsBackend
VecZnxMergeRingsTmpBytes
VecZnxMulXpMinusOneAssignBackend
VecZnxMulXpMinusOneAssignTmpBytes
VecZnxMulXpMinusOneBackend
Multiplies the selected column by (X^p - 1) in Z[X]/(X^N + 1).
VecZnxNegateAssignBackend
VecZnxNegateBackend
VecZnxNormalize
VecZnxNormalizeAssignBackend
VecZnxNormalizeCoeffAssignBackend
VecZnxNormalizeCoeffBackend
VecZnxNormalizeTmpBytes
VecZnxRotateAssignBackend
VecZnxRotateAssignTmpBytes
VecZnxRotateBackend
VecZnxRshAddCoeffIntoBackend
VecZnxRshAddIntoBackend
VecZnxRshAssignBackend
VecZnxRshBackend
VecZnxRshCoeffBackend
VecZnxRshSubBackend
VecZnxRshSubCoeffIntoBackend
VecZnxRshTmpBytes
Returns scratch bytes required for right-shift operations.
VecZnxScalarProduct
Computes the element-wise (Hadamard) product res[k] = a[k] * b[k] for all k and stores each product as a ScalarBig value in res. Use VecZnxBigInnerSumBackend afterwards to reduce to a single scalar.
VecZnxSplitRingBackend
VecZnxSplitRingTmpBytes
VecZnxSubAssignBackend
VecZnxSubBackend
VecZnxSubNegateAssignBackend
VecZnxSubScalarAssignBackend
VecZnxSubScalarBackend
VecZnxSwitchRingBackend
Switches ring degree between a and res by truncation or zero-padding.
VecZnxZeroBackend
VmpApplyDft
Applies the vector-matrix product VecZnx x VmpPMat -> VecZnxDft.
VmpApplyDftTmpBytes
Returns scratch bytes required for VmpApplyDft.
VmpApplyDftToDft
VmpApplyDftToDftAccumulate
VmpApplyDftToDftAccumulateTmpBytes
Returns scratch bytes required for VmpApplyDftToDftAccumulate.
VmpApplyDftToDftTmpBytes
Returns scratch bytes required for VmpApplyDftToDft.
VmpPMatAlloc
Allocates a VmpPMat.
VmpPMatBytesOf
Returns the byte size required for a VmpPMat.
VmpPrepare
Prepares a coefficient-domain MatZnx into a DFT-domain VmpPMat.
VmpPrepareTmpBytes
Returns scratch bytes required for VmpPrepare.
VmpZero
Zeroes all entries of a VmpPMat.