pub struct FV<T>where
T: ArithUtils<T>,{
pub n: usize,
pub t: T,
pub q: T,
pub delta: T,
pub stdev: f64,
pub qdivtwo: T,
pub flooding_stdev: f64,
/* private fields */
}Expand description
(Additive only version of) the Fan-Vercauteren homomoprhic encryption scheme.
Fields§
§n: usize§t: T§q: T§delta: T§stdev: f64§qdivtwo: T§flooding_stdev: f64Implementations§
Trait Implementations§
Source§impl<T> AdditiveHomomorphicScheme<(RqPoly<T>, RqPoly<T>), SecretKey<T>> for FV<T>where
RqPoly<T>: FiniteRingElt,
T: SuperTrait<T>,
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>)
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>)
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> CipherPlainAddition<(RqPoly<T>, RqPoly<T>), Vec<T>> for FV<T>
impl<T> CipherPlainAddition<(RqPoly<T>, RqPoly<T>), Vec<T>> for FV<T>
Source§fn add_plain_inplace(&self, ct: &mut FVCiphertext<T>, pt: &FVPlaintext<T>)
fn add_plain_inplace(&self, ct: &mut FVCiphertext<T>, pt: &FVPlaintext<T>)
Add a plaintext into a ciphertext.
Source§impl<T> CipherPlainAddition<(RqPoly<T>, RqPoly<T>), Vec<u8>> for FV<T>
impl<T> CipherPlainAddition<(RqPoly<T>, RqPoly<T>), Vec<u8>> for FV<T>
Source§fn add_plain_inplace(&self, ct: &mut FVCiphertext<T>, pt: &DefaultFVPlaintext)
fn add_plain_inplace(&self, ct: &mut FVCiphertext<T>, pt: &DefaultFVPlaintext)
Add a plaintext into a ciphertext.
Source§impl<T> EncryptionOfZeros<(RqPoly<T>, RqPoly<T>), SecretKey<T>> for FV<T>where
RqPoly<T>: FiniteRingElt,
T: SuperTrait<T>,
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>
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>
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>,
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>
fn generate_key(&self) -> SecretKey<T>
Generate a secret key
Source§fn generate_keypair(&self) -> (FVCiphertext<T>, SecretKey<T>)
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>,
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>
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>,
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>
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>,
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>
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>
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>,
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>
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
fn decrypt(&self, ct: &FVCiphertext<T>, sk: &SecretKey<T>) -> DefaultFVPlaintext
Decrypt a ciphertext
Auto Trait Implementations§
impl<T> Freeze for FV<T>where
T: Freeze,
impl<T> RefUnwindSafe for FV<T>where
T: RefUnwindSafe,
impl<T> Send for FV<T>
impl<T> Sync for FV<T>
impl<T> Unpin for FV<T>where
T: Unpin,
impl<T> UnwindSafe for FV<T>where
T: UnwindSafe + RefUnwindSafe,
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