pub struct KeySwitchKey<'a, Params: ?Sized + BGVCiphertextParams> { /* private fields */ }Expand description
A key-switching key for BGV. This includes Relinearization and Galois keys. Note that this implementation does not include an automatic management of the ciphertext modulus chain, it is up to the user to keep track of the RNS base used for each ciphertext.
Implementations§
Source§impl<'a, Params: ?Sized + BGVCiphertextParams> KeySwitchKey<'a, Params>
impl<'a, Params: ?Sized + BGVCiphertextParams> KeySwitchKey<'a, Params>
Sourcepub fn params(&self) -> KeySwitchKeyParams
pub fn params(&self) -> KeySwitchKeyParams
Returns the parameters corresponding to this key-switching key
Sourcepub fn k0<'b>(&'b self) -> &'b GadgetProductRhsOperand<Params::CiphertextRing>
pub fn k0<'b>(&'b self) -> &'b GadgetProductRhsOperand<Params::CiphertextRing>
Returns the constant component of the key-switching key, i.e. k0 from
the tuple k0, k1 that satisfies k0[i] + k1[i] * s_new = g[i] * s_old
Sourcepub fn k1<'b>(&'b self) -> &'b GadgetProductRhsOperand<Params::CiphertextRing>
pub fn k1<'b>(&'b self) -> &'b GadgetProductRhsOperand<Params::CiphertextRing>
Returns the linear component of the key-switching key, i.e. k1 from
the tuple k0, k1 that satisfies k0[i] + k1[i] * s_new = g[i] * s_old
Auto Trait Implementations§
impl<'a, Params> Freeze for KeySwitchKey<'a, Params>where
Params: ?Sized,
impl<'a, Params> RefUnwindSafe for KeySwitchKey<'a, Params>where
<Params as BGVCiphertextParams>::CiphertextRing: RefUnwindSafe,
<<Params as BGVCiphertextParams>::CiphertextRing as PreparedMultiplicationRing>::PreparedMultiplicant: RefUnwindSafe,
<<Params as BGVCiphertextParams>::CiphertextRing as RingBase>::Element: RefUnwindSafe,
Params: ?Sized,
impl<'a, Params> Send for KeySwitchKey<'a, Params>where
<Params as BGVCiphertextParams>::CiphertextRing: Sync,
<<Params as BGVCiphertextParams>::CiphertextRing as PreparedMultiplicationRing>::PreparedMultiplicant: Send,
<<Params as BGVCiphertextParams>::CiphertextRing as RingBase>::Element: Send,
Params: ?Sized,
impl<'a, Params> Sync for KeySwitchKey<'a, Params>where
<Params as BGVCiphertextParams>::CiphertextRing: Sync,
<<Params as BGVCiphertextParams>::CiphertextRing as PreparedMultiplicationRing>::PreparedMultiplicant: Sync,
<<Params as BGVCiphertextParams>::CiphertextRing as RingBase>::Element: Sync,
Params: ?Sized,
impl<'a, Params> Unpin for KeySwitchKey<'a, Params>where
<<Params as BGVCiphertextParams>::CiphertextRing as PreparedMultiplicationRing>::PreparedMultiplicant: Unpin,
<<Params as BGVCiphertextParams>::CiphertextRing as RingBase>::Element: Unpin,
Params: ?Sized,
impl<'a, Params> UnwindSafe for KeySwitchKey<'a, Params>where
<Params as BGVCiphertextParams>::CiphertextRing: RefUnwindSafe,
<<Params as BGVCiphertextParams>::CiphertextRing as PreparedMultiplicationRing>::PreparedMultiplicant: UnwindSafe,
<<Params as BGVCiphertextParams>::CiphertextRing as RingBase>::Element: UnwindSafe,
Params: ?Sized,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more