pub struct GGSWCiphertext<D: Data> { /* private fields */ }Implementations§
Source§impl GGSWCiphertext<Vec<u8>>
impl GGSWCiphertext<Vec<u8>>
pub fn automorphism_scratch_space<B: Backend>( module: &Module<B>, basek: usize, k_out: usize, k_in: usize, k_ksk: usize, digits_ksk: usize, k_tsk: usize, digits_tsk: usize, rank: usize, ) -> usize
pub fn automorphism_inplace_scratch_space<B: Backend>( module: &Module<B>, basek: usize, k_out: usize, k_ksk: usize, digits_ksk: usize, k_tsk: usize, digits_tsk: usize, rank: usize, ) -> usize
Source§impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
pub fn automorphism<DataLhs: DataRef, DataAk: DataRef, DataTsk: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
lhs: &GGSWCiphertext<DataLhs>,
auto_key: &GGLWEAutomorphismKeyPrepared<DataAk, B>,
tensor_key: &GGLWETensorKeyPrepared<DataTsk, B>,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxBigNormalizeTmpBytes + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxDftApply<B> + VecZnxIdftApplyConsume<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B> + VecZnxAutomorphismInplace<B> + VecZnxBigAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftCopy<B> + VecZnxDftAddInplace<B> + VecZnxIdftApplyTmpA<B>,
Scratch<B>: TakeVecZnxDft<B> + ScratchAvailable + TakeVecZnxBig<B>,
pub fn automorphism_inplace<DataKsk: DataRef, DataTsk: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
auto_key: &GGLWEAutomorphismKeyPrepared<DataKsk, B>,
tensor_key: &GGLWETensorKeyPrepared<DataTsk, B>,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxBigNormalizeTmpBytes + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxDftApply<B> + VecZnxIdftApplyConsume<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B> + VecZnxAutomorphismInplace<B> + VecZnxBigAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftCopy<B> + VecZnxDftAddInplace<B> + VecZnxIdftApplyTmpA<B>,
Scratch<B>: TakeVecZnxDft<B> + ScratchAvailable + TakeVecZnxBig<B>,
Source§impl GGSWCiphertext<Vec<u8>>
impl GGSWCiphertext<Vec<u8>>
Source§impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
pub fn encrypt_sk<DataPt: DataRef, DataSk: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
pt: &ScalarZnx<DataPt>,
sk: &GLWESecretPrepared<DataSk, B>,
source_xa: &mut Source,
source_xe: &mut Source,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxAddScalarInplace + VecZnxDftAllocBytes + VecZnxBigNormalize<B> + VecZnxDftApply<B> + SvpApplyDftToDftInplace<B> + VecZnxIdftApplyConsume<B> + VecZnxNormalizeTmpBytes + VecZnxFillUniform + VecZnxSubABInplace + VecZnxAddInplace + VecZnxNormalizeInplace<B> + VecZnxAddNormal + VecZnxNormalize<B> + VecZnxSub,
Scratch<B>: TakeVecZnxDft<B> + ScratchAvailable + TakeVecZnx,
Source§impl GGSWCiphertext<Vec<u8>>
impl GGSWCiphertext<Vec<u8>>
pub fn external_product_scratch_space<B: Backend>( module: &Module<B>, basek: usize, k_out: usize, k_in: usize, k_ggsw: usize, digits: usize, rank: usize, ) -> usize
pub fn external_product_inplace_scratch_space<B: Backend>( module: &Module<B>, basek: usize, k_out: usize, k_ggsw: usize, digits: usize, rank: usize, ) -> usize
Source§impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
pub fn external_product<DataLhs: DataRef, DataRhs: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
lhs: &GGSWCiphertext<DataLhs>,
rhs: &GGSWCiphertextPrepared<DataRhs, B>,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxNormalizeTmpBytes + VecZnxDftApply<B> + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxIdftApplyConsume<B> + VecZnxBigNormalize<B>,
Scratch<B>: TakeVecZnxDft<B> + ScratchAvailable,
pub fn external_product_inplace<DataRhs: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
rhs: &GGSWCiphertextPrepared<DataRhs, B>,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxNormalizeTmpBytes + VecZnxDftApply<B> + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxIdftApplyConsume<B> + VecZnxBigNormalize<B>,
Scratch<B>: TakeVecZnxDft<B> + ScratchAvailable,
Source§impl GGSWCiphertext<Vec<u8>>
impl GGSWCiphertext<Vec<u8>>
pub fn keyswitch_scratch_space<B: Backend>( module: &Module<B>, basek: usize, k_out: usize, k_in: usize, k_ksk: usize, digits_ksk: usize, k_tsk: usize, digits_tsk: usize, rank: usize, ) -> usize
pub fn keyswitch_inplace_scratch_space<B: Backend>( module: &Module<B>, basek: usize, k_out: usize, k_ksk: usize, digits_ksk: usize, k_tsk: usize, digits_tsk: usize, rank: usize, ) -> usize
Source§impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
impl<DataSelf: DataMut> GGSWCiphertext<DataSelf>
pub fn from_gglwe<DataA, DataTsk, B: Backend>(
&mut self,
module: &Module<B>,
a: &GGLWECiphertext<DataA>,
tsk: &GGLWETensorKeyPrepared<DataTsk, B>,
scratch: &mut Scratch<B>,
)where
DataA: DataRef,
DataTsk: DataRef,
Module<B>: VecZnxCopy + VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxBigAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftApply<B> + VecZnxDftCopy<B> + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxDftAddInplace<B> + VecZnxBigNormalize<B> + VecZnxIdftApplyTmpA<B>,
Scratch<B>: ScratchAvailable + TakeVecZnxDft<B> + TakeVecZnxBig<B>,
pub fn keyswitch<DataLhs: DataRef, DataKsk: DataRef, DataTsk: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
lhs: &GGSWCiphertext<DataLhs>,
ksk: &GGLWESwitchingKeyPrepared<DataKsk, B>,
tsk: &GGLWETensorKeyPrepared<DataTsk, B>,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxBigNormalizeTmpBytes + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxDftApply<B> + VecZnxIdftApplyConsume<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B> + VecZnxBigAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftCopy<B> + VecZnxDftAddInplace<B> + VecZnxIdftApplyTmpA<B>,
Scratch<B>: ScratchAvailable + TakeVecZnxDft<B> + TakeVecZnxBig<B>,
pub fn keyswitch_inplace<DataKsk: DataRef, DataTsk: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
ksk: &GGLWESwitchingKeyPrepared<DataKsk, B>,
tsk: &GGLWETensorKeyPrepared<DataTsk, B>,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxBigNormalizeTmpBytes + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxDftApply<B> + VecZnxIdftApplyConsume<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B> + VecZnxBigAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftCopy<B> + VecZnxDftAddInplace<B> + VecZnxIdftApplyTmpA<B>,
Scratch<B>: ScratchAvailable + TakeVecZnxDft<B> + TakeVecZnxBig<B>,
pub fn expand_row<DataTsk: DataRef, B: Backend>(
&mut self,
module: &Module<B>,
tsk: &GGLWETensorKeyPrepared<DataTsk, B>,
scratch: &mut Scratch<B>,
)where
Module<B>: VecZnxDftAllocBytes + VmpApplyDftToDftTmpBytes + VecZnxBigAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftApply<B> + VecZnxDftCopy<B> + VmpApplyDftToDft<B> + VmpApplyDftToDftAdd<B> + VecZnxDftAddInplace<B> + VecZnxBigNormalize<B> + VecZnxIdftApplyTmpA<B>,
Scratch<B>: ScratchAvailable + TakeVecZnxDft<B> + TakeVecZnxBig<B>,
Source§impl<D: DataRef> GGSWCiphertext<D>
impl<D: DataRef> GGSWCiphertext<D>
pub fn assert_noise<B, DataSk, DataScalar, F>(
&self,
module: &Module<B>,
sk_prepared: &GLWESecretPrepared<DataSk, B>,
pt_want: &ScalarZnx<DataScalar>,
max_noise: F,
)where
DataSk: DataRef,
DataScalar: DataRef,
Module<B>: VecZnxDftAllocBytes + VecZnxBigAllocBytes + VecZnxDftApply<B> + SvpApplyDftToDftInplace<B> + VecZnxIdftApplyConsume<B> + VecZnxBigAddInplace<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B> + VecZnxNormalizeTmpBytes + VecZnxBigAlloc<B> + VecZnxDftAlloc<B> + VecZnxBigNormalizeTmpBytes + VecZnxIdftApplyTmpA<B> + VecZnxAddScalarInplace + VecZnxSubABInplace,
B: Backend + TakeVecZnxDftImpl<B> + TakeVecZnxBigImpl<B> + ScratchOwnedAllocImpl<B> + ScratchOwnedBorrowImpl<B>,
F: Fn(usize) -> f64,
Source§impl<D: DataRef> GGSWCiphertext<D>
impl<D: DataRef> GGSWCiphertext<D>
pub fn print_noise<B, DataSk, DataScalar>(
&self,
module: &Module<B>,
sk_prepared: &GLWESecretPrepared<DataSk, B>,
pt_want: &ScalarZnx<DataScalar>,
)where
DataSk: DataRef,
DataScalar: DataRef,
Module<B>: VecZnxDftAllocBytes + VecZnxBigAllocBytes + VecZnxDftApply<B> + SvpApplyDftToDftInplace<B> + VecZnxIdftApplyConsume<B> + VecZnxBigAddInplace<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B> + VecZnxNormalizeTmpBytes + VecZnxBigAlloc<B> + VecZnxDftAlloc<B> + VecZnxBigNormalizeTmpBytes + VecZnxIdftApplyTmpA<B> + VecZnxAddScalarInplace + VecZnxSubABInplace,
B: Backend + TakeVecZnxDftImpl<B> + TakeVecZnxBigImpl<B> + ScratchOwnedAllocImpl<B> + ScratchOwnedBorrowImpl<B>,
Source§impl<D: DataRef> GGSWCiphertext<D>
impl<D: DataRef> GGSWCiphertext<D>
Source§impl<D: DataMut> GGSWCiphertext<D>
impl<D: DataMut> GGSWCiphertext<D>
Source§impl GGSWCiphertext<Vec<u8>>
impl GGSWCiphertext<Vec<u8>>
Trait Implementations§
Source§impl<D: Clone + Data> Clone for GGSWCiphertext<D>
impl<D: Clone + Data> Clone for GGSWCiphertext<D>
Source§fn clone(&self) -> GGSWCiphertext<D>
fn clone(&self) -> GGSWCiphertext<D>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D: DataRef> Debug for GGSWCiphertext<D>
impl<D: DataRef> Debug for GGSWCiphertext<D>
Source§impl<D: DataMut, B: Backend, DR: DataRef> Decompress<B, GGSWCiphertextCompressed<DR>> for GGSWCiphertext<D>
impl<D: DataMut, B: Backend, DR: DataRef> Decompress<B, GGSWCiphertextCompressed<DR>> for GGSWCiphertext<D>
fn decompress( &mut self, module: &Module<B>, other: &GGSWCiphertextCompressed<DR>, )
Source§impl<D: DataRef> Display for GGSWCiphertext<D>
impl<D: DataRef> Display for GGSWCiphertext<D>
Source§impl<D: DataMut> FillUniform for GGSWCiphertext<D>
impl<D: DataMut> FillUniform for GGSWCiphertext<D>
fn fill_uniform(&mut self, log_bound: usize, source: &mut Source)
Source§impl<D: Data> Infos for GGSWCiphertext<D>
impl<D: Data> Infos for GGSWCiphertext<D>
Source§impl<D: DataMut, DR: DataRef, B: Backend> Prepare<B, GGSWCiphertext<DR>> for GGSWCiphertextPrepared<D, B>where
Module<B>: VmpPrepare<B>,
impl<D: DataMut, DR: DataRef, B: Backend> Prepare<B, GGSWCiphertext<DR>> for GGSWCiphertextPrepared<D, B>where
Module<B>: VmpPrepare<B>,
Source§impl<D: DataRef, B: Backend> PrepareAlloc<B, GGSWCiphertextPrepared<Vec<u8>, B>> for GGSWCiphertext<D>
impl<D: DataRef, B: Backend> PrepareAlloc<B, GGSWCiphertextPrepared<Vec<u8>, B>> for GGSWCiphertext<D>
fn prepare_alloc( &self, module: &Module<B>, scratch: &mut Scratch<B>, ) -> GGSWCiphertextPrepared<Vec<u8>, B>
Source§impl<D: DataMut> ReaderFrom for GGSWCiphertext<D>
impl<D: DataMut> ReaderFrom for GGSWCiphertext<D>
Source§impl<'a, B, D> TakeLike<'a, B, GGSWCiphertext<D>> for Scratch<B>
impl<'a, B, D> TakeLike<'a, B, GGSWCiphertext<D>> for Scratch<B>
type Output = GGSWCiphertext<&'a mut [u8]>
fn take_like( &'a mut self, template: &GGSWCiphertext<D>, ) -> (Self::Output, &'a mut Self)
Source§impl<D: DataRef> WriterTo for GGSWCiphertext<D>
impl<D: DataRef> WriterTo for GGSWCiphertext<D>
impl<D: Eq + Data> Eq for GGSWCiphertext<D>
impl<D: Data> StructuralPartialEq for GGSWCiphertext<D>
Auto Trait Implementations§
impl<D> Freeze for GGSWCiphertext<D>where
D: Freeze,
impl<D> RefUnwindSafe for GGSWCiphertext<D>where
D: RefUnwindSafe,
impl<D> Send for GGSWCiphertext<D>where
D: Send,
impl<D> Sync for GGSWCiphertext<D>where
D: Sync,
impl<D> Unpin for GGSWCiphertext<D>where
D: Unpin,
impl<D> UnwindSafe for GGSWCiphertext<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.