pub struct EncryptionKey {
pub n: BigInt,
pub nn: BigInt,
}Expand description
Public encryption key.
Fields§
§n: BigInt§nn: BigIntTrait Implementations§
Source§impl<'c, 'm, 'd> Add<EncryptionKey, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
impl<'c, 'm, 'd> Add<EncryptionKey, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
Source§fn add(
ek: &EncryptionKey,
c: RawCiphertext<'c>,
m: RawPlaintext<'m>,
) -> RawCiphertext<'d>
fn add( ek: &EncryptionKey, c: RawCiphertext<'c>, m: RawPlaintext<'m>, ) -> RawCiphertext<'d>
Homomorphically combine ciphertexts
c1 and c2 to obtain a ciphertext containing
the sum of the two underlying plaintexts, reduced modulus n from ek.Source§impl<'c1, 'c2, 'd> Add<EncryptionKey, RawCiphertext<'c1>, RawCiphertext<'c2>, RawCiphertext<'d>> for Paillier
impl<'c1, 'c2, 'd> Add<EncryptionKey, RawCiphertext<'c1>, RawCiphertext<'c2>, RawCiphertext<'d>> for Paillier
Source§fn add(
ek: &EncryptionKey,
c1: RawCiphertext<'c1>,
c2: RawCiphertext<'c2>,
) -> RawCiphertext<'d>
fn add( ek: &EncryptionKey, c1: RawCiphertext<'c1>, c2: RawCiphertext<'c2>, ) -> RawCiphertext<'d>
Homomorphically combine ciphertexts
c1 and c2 to obtain a ciphertext containing
the sum of the two underlying plaintexts, reduced modulus n from ek.Source§impl<'c, 'm, 'd> Add<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
impl<'c, 'm, 'd> Add<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
Source§fn add(
ek: &EncryptionKey,
m: RawPlaintext<'m>,
c: RawCiphertext<'c>,
) -> RawCiphertext<'d>
fn add( ek: &EncryptionKey, m: RawPlaintext<'m>, c: RawCiphertext<'c>, ) -> RawCiphertext<'d>
Homomorphically combine ciphertexts
c1 and c2 to obtain a ciphertext containing
the sum of the two underlying plaintexts, reduced modulus n from ek.Source§impl Clone for EncryptionKey
impl Clone for EncryptionKey
Source§fn clone(&self) -> EncryptionKey
fn clone(&self) -> EncryptionKey
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 Debug for EncryptionKey
impl Debug for EncryptionKey
Source§impl<'de> Deserialize<'de> for EncryptionKey
impl<'de> Deserialize<'de> for EncryptionKey
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'m, 'd> Encrypt<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
impl<'m, 'd> Encrypt<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
Source§fn encrypt(ek: &EncryptionKey, m: RawPlaintext<'m>) -> RawCiphertext<'d>
fn encrypt(ek: &EncryptionKey, m: RawPlaintext<'m>) -> RawCiphertext<'d>
Encrypt plaintext
m under key ek into a ciphertext.Source§impl<'m, 'r, 'd> EncryptWithChosenRandomness<EncryptionKey, RawPlaintext<'m>, &'r PrecomputedRandomness, RawCiphertext<'d>> for Paillier
impl<'m, 'r, 'd> EncryptWithChosenRandomness<EncryptionKey, RawPlaintext<'m>, &'r PrecomputedRandomness, RawCiphertext<'d>> for Paillier
fn encrypt_with_chosen_randomness( ek: &EncryptionKey, m: RawPlaintext<'m>, rn: &'r PrecomputedRandomness, ) -> RawCiphertext<'d>
Source§impl<'m, 'r, 'd> EncryptWithChosenRandomness<EncryptionKey, RawPlaintext<'m>, &'r Randomness, RawCiphertext<'d>> for Paillier
impl<'m, 'r, 'd> EncryptWithChosenRandomness<EncryptionKey, RawPlaintext<'m>, &'r Randomness, RawCiphertext<'d>> for Paillier
fn encrypt_with_chosen_randomness( ek: &EncryptionKey, m: RawPlaintext<'m>, r: &'r Randomness, ) -> RawCiphertext<'d>
Source§impl<'e> From<&'e EncryptionKey> for MinimalEncryptionKey
impl<'e> From<&'e EncryptionKey> for MinimalEncryptionKey
Source§fn from(ek: &'e EncryptionKey) -> Self
fn from(ek: &'e EncryptionKey) -> Self
Converts to this type from the input type.
Source§impl<'kp> From<&'kp Keypair> for EncryptionKey
impl<'kp> From<&'kp Keypair> for EncryptionKey
Source§impl<'n> From<&'n Mpz> for EncryptionKey
impl<'n> From<&'n Mpz> for EncryptionKey
Source§impl<'e> From<MinimalEncryptionKey> for EncryptionKey
impl<'e> From<MinimalEncryptionKey> for EncryptionKey
Source§fn from(ek: MinimalEncryptionKey) -> Self
fn from(ek: MinimalEncryptionKey) -> Self
Converts to this type from the input type.
Source§impl<'c, 'm, 'd> Mul<EncryptionKey, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
impl<'c, 'm, 'd> Mul<EncryptionKey, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
Source§fn mul(
ek: &EncryptionKey,
c: RawCiphertext<'c>,
m: RawPlaintext<'m>,
) -> RawCiphertext<'d>
fn mul( ek: &EncryptionKey, c: RawCiphertext<'c>, m: RawPlaintext<'m>, ) -> RawCiphertext<'d>
Homomorphically combine ciphertext
c1 and plaintext m2 to obtain a ciphertext
containing the multiplication of the (underlying) plaintexts, reduced modulus n from ek.Source§impl<'c, 'm, 'd> Mul<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
impl<'c, 'm, 'd> Mul<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
Source§fn mul(
ek: &EncryptionKey,
m: RawPlaintext<'m>,
c: RawCiphertext<'c>,
) -> RawCiphertext<'d>
fn mul( ek: &EncryptionKey, m: RawPlaintext<'m>, c: RawCiphertext<'c>, ) -> RawCiphertext<'d>
Homomorphically combine ciphertext
c1 and plaintext m2 to obtain a ciphertext
containing the multiplication of the (underlying) plaintexts, reduced modulus n from ek.Source§impl PartialEq for EncryptionKey
impl PartialEq for EncryptionKey
Source§impl<'ek, 'r> PrecomputeRandomness<&'ek EncryptionKey, &'r Mpz, PrecomputedRandomness> for Paillier
impl<'ek, 'r> PrecomputeRandomness<&'ek EncryptionKey, &'r Mpz, PrecomputedRandomness> for Paillier
fn precompute(ek: &'ek EncryptionKey, r: &'r BigInt) -> PrecomputedRandomness
Source§impl<'c, 'd> Rerandomize<EncryptionKey, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
impl<'c, 'd> Rerandomize<EncryptionKey, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
Source§fn rerandomize(ek: &EncryptionKey, c: RawCiphertext<'c>) -> RawCiphertext<'d>
fn rerandomize(ek: &EncryptionKey, c: RawCiphertext<'c>) -> RawCiphertext<'d>
Rerandomise ciphertext
c to hide any history of which homomorphic operations were
used to compute it, making it look exactly like a fresh encryption of the same plaintext.Source§impl Serialize for EncryptionKey
impl Serialize for EncryptionKey
impl StructuralPartialEq for EncryptionKey
Auto Trait Implementations§
impl Freeze for EncryptionKey
impl RefUnwindSafe for EncryptionKey
impl Send for EncryptionKey
impl Sync for EncryptionKey
impl Unpin for EncryptionKey
impl UnwindSafe for EncryptionKey
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