pub struct LWECiphertext<D: Data> { /* private fields */ }Implementations§
Source§impl LWECiphertext<Vec<u8>>
impl LWECiphertext<Vec<u8>>
Source§impl<DLwe: DataMut> LWECiphertext<DLwe>
impl<DLwe: DataMut> LWECiphertext<DLwe>
pub fn sample_extract<DGlwe: DataRef>(&mut self, a: &GLWECiphertext<DGlwe>)
pub fn from_glwe<DGlwe, DKs, B: Backend>(
&mut self,
module: &Module<B>,
a: &GLWECiphertext<DGlwe>,
ks: &GLWEToLWESwitchingKeyPrepared<DKs, B>,
scratch: &mut Scratch<B>,
)where
DGlwe: DataRef,
DKs: DataRef,
Module<B>: VecZnxDftAllocBytes + VmpApplyTmpBytes + VecZnxBigNormalizeTmpBytes + VmpApply<B> + VmpApplyAdd<B> + VecZnxDftFromVecZnx<B> + VecZnxDftToVecZnxBigConsume<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B>,
Scratch<B>: ScratchAvailable + TakeVecZnxDft<B> + TakeGLWECt,
Source§impl<DataSelf> LWECiphertext<DataSelf>where
DataSelf: DataRef,
impl<DataSelf> LWECiphertext<DataSelf>where
DataSelf: DataRef,
pub fn decrypt<DataPt, DataSk, B>(
&self,
module: &Module<B>,
pt: &mut LWEPlaintext<DataPt>,
sk: &LWESecret<DataSk>,
)where
DataPt: DataMut,
DataSk: DataRef,
Module<B>: VecZnxNormalizeInplace<B>,
B: Backend + ScratchOwnedAllocImpl<B> + ScratchOwnedBorrowImpl<B>,
Source§impl<DataSelf: DataMut> LWECiphertext<DataSelf>
impl<DataSelf: DataMut> LWECiphertext<DataSelf>
pub fn encrypt_sk<DataPt, DataSk, B>(
&mut self,
module: &Module<B>,
pt: &LWEPlaintext<DataPt>,
sk: &LWESecret<DataSk>,
source_xa: &mut Source,
source_xe: &mut Source,
sigma: f64,
)where
DataPt: DataRef,
DataSk: DataRef,
Module<B>: VecZnxFillUniform + VecZnxAddNormal + VecZnxNormalizeInplace<B>,
B: Backend + ScratchOwnedAllocImpl<B> + ScratchOwnedBorrowImpl<B>,
Source§impl LWECiphertext<Vec<u8>>
impl LWECiphertext<Vec<u8>>
pub fn keyswitch_scratch_space<B: Backend>(
module: &Module<B>,
n: usize,
basek: usize,
k_lwe_out: usize,
k_lwe_in: usize,
k_ksk: usize,
) -> usizewhere
Module<B>: VecZnxDftAllocBytes + VmpApplyTmpBytes + VecZnxBigNormalizeTmpBytes + VmpApply<B> + VmpApplyAdd<B> + VecZnxDftFromVecZnx<B> + VecZnxDftToVecZnxBigConsume<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B>,
Source§impl<DLwe: DataMut> LWECiphertext<DLwe>
impl<DLwe: DataMut> LWECiphertext<DLwe>
pub fn keyswitch<A, DKs, B: Backend>(
&mut self,
module: &Module<B>,
a: &LWECiphertext<A>,
ksk: &LWESwitchingKeyPrepared<DKs, B>,
scratch: &mut Scratch<B>,
)where
A: DataRef,
DKs: DataRef,
Module<B>: VecZnxDftAllocBytes + VmpApplyTmpBytes + VecZnxBigNormalizeTmpBytes + VmpApply<B> + VmpApplyAdd<B> + VecZnxDftFromVecZnx<B> + VecZnxDftToVecZnxBigConsume<B> + VecZnxBigAddSmallInplace<B> + VecZnxBigNormalize<B>,
Scratch<B>: TakeVecZnxDft<B> + ScratchAvailable + TakeVecZnx,
Trait Implementations§
Source§impl<D: Clone + Data> Clone for LWECiphertext<D>
impl<D: Clone + Data> Clone for LWECiphertext<D>
Source§fn clone(&self) -> LWECiphertext<D>
fn clone(&self) -> LWECiphertext<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 LWECiphertext<D>
impl<D: DataRef> Debug for LWECiphertext<D>
Source§impl<D: DataMut, B: Backend, DR: DataRef> Decompress<B, LWECiphertextCompressed<DR>> for LWECiphertext<D>
impl<D: DataMut, B: Backend, DR: DataRef> Decompress<B, LWECiphertextCompressed<DR>> for LWECiphertext<D>
fn decompress(
&mut self,
module: &Module<B>,
other: &LWECiphertextCompressed<DR>,
)where
Module<B>: VecZnxFillUniform,
Source§impl<D: DataRef> Display for LWECiphertext<D>
impl<D: DataRef> Display for LWECiphertext<D>
Source§impl<D: DataMut> FillUniform for LWECiphertext<D>where
VecZnx<D>: FillUniform,
impl<D: DataMut> FillUniform for LWECiphertext<D>where
VecZnx<D>: FillUniform,
fn fill_uniform(&mut self, source: &mut Source)
Source§impl<D: Data> Infos for LWECiphertext<D>
impl<D: Data> Infos for LWECiphertext<D>
Source§impl<D: DataMut> LWECiphertextToMut for LWECiphertext<D>
impl<D: DataMut> LWECiphertextToMut for LWECiphertext<D>
fn to_mut(&mut self) -> LWECiphertext<&mut [u8]>
Source§impl<D: DataRef> LWECiphertextToRef for LWECiphertext<D>
impl<D: DataRef> LWECiphertextToRef for LWECiphertext<D>
fn to_ref(&self) -> LWECiphertext<&[u8]>
Source§impl<D: DataMut> ReaderFrom for LWECiphertext<D>
impl<D: DataMut> ReaderFrom for LWECiphertext<D>
Source§impl<DataSelf: DataMut> SetMetaData for LWECiphertext<DataSelf>
impl<DataSelf: DataMut> SetMetaData for LWECiphertext<DataSelf>
Source§impl<D: DataRef> WriterTo for LWECiphertext<D>
impl<D: DataRef> WriterTo for LWECiphertext<D>
impl<D: Eq + Data> Eq for LWECiphertext<D>
impl<D: Data> StructuralPartialEq for LWECiphertext<D>
Auto Trait Implementations§
impl<D> Freeze for LWECiphertext<D>where
D: Freeze,
impl<D> RefUnwindSafe for LWECiphertext<D>where
D: RefUnwindSafe,
impl<D> Send for LWECiphertext<D>where
D: Send,
impl<D> Sync for LWECiphertext<D>where
D: Sync,
impl<D> Unpin for LWECiphertext<D>where
D: Unpin,
impl<D> UnwindSafe for LWECiphertext<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> 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.