Struct paillier::EncryptionKey
source · Expand description
Public encryption key.
Fields
n: BigInt
nn: BigInt
Trait Implementations
sourceimpl<'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
sourcefn 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
. Read moresourceimpl<'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
sourcefn 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
. Read moresourceimpl<'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
sourcefn 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
. Read moresourceimpl Clone for EncryptionKey
impl Clone for EncryptionKey
sourcefn clone(&self) -> EncryptionKey
fn clone(&self) -> EncryptionKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for EncryptionKey
impl Debug for EncryptionKey
sourceimpl<'de> Deserialize<'de> for EncryptionKey
impl<'de> Deserialize<'de> for EncryptionKey
sourcefn 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
sourceimpl<'m, 'd> Encrypt<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
impl<'m, 'd> Encrypt<EncryptionKey, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
sourcefn 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.sourceimpl<'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>
sourceimpl<'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>
sourceimpl<'e> From<&'e EncryptionKey> for MinimalEncryptionKey
impl<'e> From<&'e EncryptionKey> for MinimalEncryptionKey
sourcefn from(ek: &'e EncryptionKey) -> Self
fn from(ek: &'e EncryptionKey) -> Self
Converts to this type from the input type.
sourceimpl<'kp> From<&'kp Keypair> for EncryptionKey
impl<'kp> From<&'kp Keypair> for EncryptionKey
sourceimpl<'n> From<&'n BigInt> for EncryptionKey
impl<'n> From<&'n BigInt> for EncryptionKey
sourceimpl<'e> From<MinimalEncryptionKey> for EncryptionKey
impl<'e> From<MinimalEncryptionKey> for EncryptionKey
sourcefn from(ek: MinimalEncryptionKey) -> Self
fn from(ek: MinimalEncryptionKey) -> Self
Converts to this type from the input type.
sourceimpl<'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
sourcefn 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
. Read moresourceimpl<'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
sourcefn 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
. Read moresourceimpl PartialEq<EncryptionKey> for EncryptionKey
impl PartialEq<EncryptionKey> for EncryptionKey
sourcefn eq(&self, other: &EncryptionKey) -> bool
fn eq(&self, other: &EncryptionKey) -> bool
sourceimpl<'ek, 'r> PrecomputeRandomness<&'ek EncryptionKey, &'r BigInt, PrecomputedRandomness> for Paillier
impl<'ek, 'r> PrecomputeRandomness<&'ek EncryptionKey, &'r BigInt, PrecomputedRandomness> for Paillier
fn precompute(ek: &'ek EncryptionKey, r: &'r BigInt) -> PrecomputedRandomness
sourceimpl<'c, 'd> Rerandomize<EncryptionKey, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
impl<'c, 'd> Rerandomize<EncryptionKey, RawCiphertext<'c>, RawCiphertext<'d>> for Paillier
sourcefn 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. Read moresourceimpl Serialize for EncryptionKey
impl Serialize for EncryptionKey
impl StructuralPartialEq for EncryptionKey
Auto Trait Implementations
impl RefUnwindSafe for EncryptionKey
impl Send for EncryptionKey
impl Sync for EncryptionKey
impl Unpin for EncryptionKey
impl UnwindSafe for EncryptionKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more