Struct SecretKey

Source
pub struct SecretKey<T>(/* private fields */);
Expand description

SecretKey type

Trait Implementations§

Source§

impl<T> AdditiveHomomorphicScheme<(RqPoly<T>, RqPoly<T>), SecretKey<T>> for FV<T>
where RqPoly<T>: FiniteRingElt, T: SuperTrait<T>,

Source§

fn add_inplace(&self, ct1: &mut FVCiphertext<T>, ct2: &FVCiphertext<T>)

Add a ciphertext into another.
Source§

fn rerandomize(&self, ct: &mut FVCiphertext<T>, pk: &FVCiphertext<T>)

Rerandomize a ciphertext in-place. The resulting ciphertext will decrypt to the same plaintext, while being unlinkable to the input ciphertext.
Source§

impl<T> EncryptionOfZeros<(RqPoly<T>, RqPoly<T>), SecretKey<T>> for FV<T>
where RqPoly<T>: FiniteRingElt, T: SuperTrait<T>,

Source§

fn encrypt_zero(&self, pk: &FVCiphertext<T>) -> FVCiphertext<T>

Generate a fresh encryption of the zero plaintext
Source§

fn encrypt_zero_sk(&self, sk: &SecretKey<T>) -> FVCiphertext<T>

Use the secret key to generate a fresh encryption of zero
Source§

impl<T> KeyGeneration<(RqPoly<T>, RqPoly<T>), SecretKey<T>> for FV<T>
where RqPoly<T>: FiniteRingElt, T: SuperTrait<T>,

Source§

fn generate_key(&self) -> SecretKey<T>

Generate a secret key
Source§

fn generate_keypair(&self) -> (FVCiphertext<T>, SecretKey<T>)

Generate a (pk, sk) keypair
Source§

impl<T> PKEncryption<(RqPoly<T>, RqPoly<T>), Vec<T>, SecretKey<T>> for FV<T>
where RqPoly<T>: FiniteRingElt, T: SuperTrait<T>,

Source§

fn encrypt(&self, pt: &FVPlaintext<T>, pk: &FVCiphertext<T>) -> FVCiphertext<T>

Encrypt a given plaintext
Source§

impl<T> PKEncryption<(RqPoly<T>, RqPoly<T>), Vec<u8>, SecretKey<T>> for FV<T>
where RqPoly<T>: FiniteRingElt, T: SuperTrait<T>,

Source§

fn encrypt( &self, pt: &DefaultFVPlaintext, pk: &FVCiphertext<T>, ) -> FVCiphertext<T>

Encrypt a given plaintext
Source§

impl<T> SKEncryption<(RqPoly<T>, RqPoly<T>), Vec<T>, SecretKey<T>> for FV<T>
where RqPoly<T>: FiniteRingElt, T: SuperTrait<T>,

Source§

fn encrypt_sk(&self, pt: &FVPlaintext<T>, sk: &SecretKey<T>) -> FVCiphertext<T>

Encrypt a given plaintext
Source§

fn decrypt(&self, ct: &FVCiphertext<T>, sk: &SecretKey<T>) -> FVPlaintext<T>

Decrypt a ciphertext
Source§

impl<T> SKEncryption<(RqPoly<T>, RqPoly<T>), Vec<u8>, SecretKey<T>> for FV<T>
where RqPoly<T>: FiniteRingElt, T: SuperTrait<T>,

Source§

fn encrypt_sk( &self, pt: &DefaultFVPlaintext, sk: &SecretKey<T>, ) -> FVCiphertext<T>

Encrypt a given plaintext
Source§

fn decrypt(&self, ct: &FVCiphertext<T>, sk: &SecretKey<T>) -> DefaultFVPlaintext

Decrypt a ciphertext

Auto Trait Implementations§

§

impl<T> Freeze for SecretKey<T>

§

impl<T> RefUnwindSafe for SecretKey<T>
where T: RefUnwindSafe,

§

impl<T> Send for SecretKey<T>
where T: Sync + Send,

§

impl<T> Sync for SecretKey<T>
where T: Sync + Send,

§

impl<T> Unpin for SecretKey<T>
where T: Unpin,

§

impl<T> UnwindSafe for SecretKey<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.