pub struct Paillier;
Expand description
Main struct onto which most operations are added.
Trait Implementations
sourceimpl<EK, C> Add<EK, C, u64, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c, 'p, 'd> Self: Add<EK, RawCiphertext<'c>, RawPlaintext<'p>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
impl<EK, C> Add<EK, C, u64, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c, 'p, 'd> Self: Add<EK, RawCiphertext<'c>, RawPlaintext<'p>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
sourceimpl<EK, C> Add<EK, C, u64, EncodedCiphertext<u64>> for Paillierwhere
for<'c, 'p, 'd> Self: Add<EK, RawCiphertext<'c>, RawPlaintext<'p>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
impl<EK, C> Add<EK, C, u64, EncodedCiphertext<u64>> for Paillierwhere
for<'c, 'p, 'd> Self: Add<EK, RawCiphertext<'c>, RawPlaintext<'p>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
sourceimpl<EK, C1, C2> Add<EK, C1, C2, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c1, 'c2, 'd> Self: Add<EK, RawCiphertext<'c1>, RawCiphertext<'c2>, RawCiphertext<'d>>,
C1: Borrow<EncodedCiphertext<Vec<u64>>>,
C2: Borrow<EncodedCiphertext<Vec<u64>>>,
impl<EK, C1, C2> Add<EK, C1, C2, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c1, 'c2, 'd> Self: Add<EK, RawCiphertext<'c1>, RawCiphertext<'c2>, RawCiphertext<'d>>,
C1: Borrow<EncodedCiphertext<Vec<u64>>>,
C2: Borrow<EncodedCiphertext<Vec<u64>>>,
sourceimpl<EK, C1, C2> Add<EK, C1, C2, EncodedCiphertext<u64>> for Paillierwhere
for<'c1, 'c2, 'd> Self: Add<EK, RawCiphertext<'c1>, RawCiphertext<'c2>, RawCiphertext<'d>>,
C1: Borrow<EncodedCiphertext<u64>>,
C2: Borrow<EncodedCiphertext<u64>>,
impl<EK, C1, C2> Add<EK, C1, C2, EncodedCiphertext<u64>> for Paillierwhere
for<'c1, 'c2, 'd> Self: Add<EK, RawCiphertext<'c1>, RawCiphertext<'c2>, RawCiphertext<'d>>,
C1: Borrow<EncodedCiphertext<u64>>,
C2: Borrow<EncodedCiphertext<u64>>,
sourceimpl<EK, C2> Add<EK, u64, C2, EncodedCiphertext<u64>> for Paillierwhere
for<'m, 'c, 'd> Self: Add<EK, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>>,
C2: Borrow<EncodedCiphertext<u64>>,
impl<EK, C2> Add<EK, u64, C2, EncodedCiphertext<u64>> for Paillierwhere
for<'m, 'c, 'd> Self: Add<EK, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>>,
C2: Borrow<EncodedCiphertext<u64>>,
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<DK, C> Decrypt<DK, C, Vec<u64, Global>> for Paillierwhere
for<'c, 'p> Self: Decrypt<DK, RawCiphertext<'c>, RawPlaintext<'p>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
impl<DK, C> Decrypt<DK, C, Vec<u64, Global>> for Paillierwhere
for<'c, 'p> Self: Decrypt<DK, RawCiphertext<'c>, RawPlaintext<'p>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
sourceimpl<DK, C> Decrypt<DK, C, u64> for Paillierwhere
for<'c, 'p> Self: Decrypt<DK, RawCiphertext<'c>, RawPlaintext<'p>>,
C: Borrow<EncodedCiphertext<u64>>,
impl<DK, C> Decrypt<DK, C, u64> for Paillierwhere
for<'c, 'p> Self: Decrypt<DK, RawCiphertext<'c>, RawPlaintext<'p>>,
C: Borrow<EncodedCiphertext<u64>>,
sourceimpl<'c, 'm> Decrypt<DecryptionKey, &'c RawCiphertext<'c>, RawPlaintext<'m>> for Paillier
impl<'c, 'm> Decrypt<DecryptionKey, &'c RawCiphertext<'c>, RawPlaintext<'m>> for Paillier
TODO
Efficient decryption using CRT based on Paillier99, section 7
sourcefn decrypt(dk: &DecryptionKey, c: &'c RawCiphertext<'c>) -> RawPlaintext<'m>
fn decrypt(dk: &DecryptionKey, c: &'c RawCiphertext<'c>) -> RawPlaintext<'m>
Decrypt ciphertext
c
using key dk
into a plaintext.sourceimpl<'c, 'm> Decrypt<DecryptionKey, RawCiphertext<'c>, RawPlaintext<'m>> for Paillier
impl<'c, 'm> Decrypt<DecryptionKey, RawCiphertext<'c>, RawPlaintext<'m>> for Paillier
TODO
Efficient decryption using CRT based on Paillier99, section 7
sourcefn decrypt(dk: &DecryptionKey, c: RawCiphertext<'c>) -> RawPlaintext<'m>
fn decrypt(dk: &DecryptionKey, c: RawCiphertext<'c>) -> RawPlaintext<'m>
Decrypt ciphertext
c
using key dk
into a plaintext.sourceimpl<'m, 'd> Encrypt<DecryptionKey, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
impl<'m, 'd> Encrypt<DecryptionKey, RawPlaintext<'m>, RawCiphertext<'d>> for Paillier
sourcefn encrypt(dk: &DecryptionKey, m: RawPlaintext<'m>) -> RawCiphertext<'d>
fn encrypt(dk: &DecryptionKey, m: RawPlaintext<'m>) -> RawCiphertext<'d>
Encrypt plaintext
m
under key ek
into a ciphertext.sourceimpl<'m, EK> Encrypt<EK, &'m [u64], EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'p, 'c> Self: Encrypt<EK, RawPlaintext<'p>, RawCiphertext<'c>>,
impl<'m, EK> Encrypt<EK, &'m [u64], EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'p, 'c> Self: Encrypt<EK, RawPlaintext<'p>, RawCiphertext<'c>>,
sourceimpl<EK> Encrypt<EK, u64, EncodedCiphertext<u64>> for Paillierwhere
for<'p, 'c> Self: Encrypt<EK, RawPlaintext<'p>, RawCiphertext<'c>>,
impl<EK> Encrypt<EK, u64, EncodedCiphertext<u64>> for Paillierwhere
for<'p, 'c> Self: Encrypt<EK, RawPlaintext<'p>, RawCiphertext<'c>>,
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<DecryptionKey, RawPlaintext<'m>, &'r PrecomputedRandomness, RawCiphertext<'d>> for Paillier
impl<'m, 'r, 'd> EncryptWithChosenRandomness<DecryptionKey, RawPlaintext<'m>, &'r PrecomputedRandomness, RawCiphertext<'d>> for Paillier
fn encrypt_with_chosen_randomness(
dk: &DecryptionKey,
m: RawPlaintext<'m>,
rn: &'r PrecomputedRandomness
) -> RawCiphertext<'d>
sourceimpl<'m, 'r, 'd> EncryptWithChosenRandomness<DecryptionKey, RawPlaintext<'m>, &'r Randomness, RawCiphertext<'d>> for Paillier
impl<'m, 'r, 'd> EncryptWithChosenRandomness<DecryptionKey, RawPlaintext<'m>, &'r Randomness, RawCiphertext<'d>> for Paillier
fn encrypt_with_chosen_randomness(
dk: &DecryptionKey,
m: RawPlaintext<'m>,
r: &'r Randomness
) -> RawCiphertext<'d>
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 KeyGeneration<Keypair> for Paillier
impl KeyGeneration<Keypair> for Paillier
sourcefn keypair_with_modulus_size(bit_length: usize) -> Keypair
fn keypair_with_modulus_size(bit_length: usize) -> Keypair
Generate fresh key pair with security level specified as the
bit_length
of the modulus. Read morefn keypair_safe_primes_with_modulus_size(bit_length: usize) -> Keypair
sourcefn keypair() -> KP
fn keypair() -> KP
Generate fresh key pair with currently recommended security level (2048 bit modulus).
fn keypair_safe_primes() -> KP
sourceimpl<EK, C> Mul<EK, C, u64, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c, 'm, 'd> Self: Mul<EK, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
impl<EK, C> Mul<EK, C, u64, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c, 'm, 'd> Self: Mul<EK, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
sourceimpl<EK, C> Mul<EK, C, u64, EncodedCiphertext<u64>> for Paillierwhere
for<'c, 'm, 'd> Self: Mul<EK, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
impl<EK, C> Mul<EK, C, u64, EncodedCiphertext<u64>> for Paillierwhere
for<'c, 'm, 'd> Self: Mul<EK, RawCiphertext<'c>, RawPlaintext<'m>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
sourceimpl<EK, C> Mul<EK, u64, C, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'m, 'c, 'd> Self: Mul<EK, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
impl<EK, C> Mul<EK, u64, C, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'m, 'c, 'd> Self: Mul<EK, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
sourceimpl<EK, C> Mul<EK, u64, C, EncodedCiphertext<u64>> for Paillierwhere
for<'m, 'c, 'd> Self: Mul<EK, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
impl<EK, C> Mul<EK, u64, C, EncodedCiphertext<u64>> for Paillierwhere
for<'m, 'c, 'd> Self: Mul<EK, RawPlaintext<'m>, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
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<'c, 'm> Open<DecryptionKey, &'c RawCiphertext<'c>, RawPlaintext<'m>, Randomness> for Paillier
impl<'c, 'm> Open<DecryptionKey, &'c RawCiphertext<'c>, RawPlaintext<'m>, Randomness> for Paillier
sourcefn open(
dk: &DecryptionKey,
c: &'c RawCiphertext<'c>
) -> (RawPlaintext<'m>, Randomness)
fn open(
dk: &DecryptionKey,
c: &'c RawCiphertext<'c>
) -> (RawPlaintext<'m>, Randomness)
Open ciphertext
c
using key dk
into a plaintext and a randomness.sourceimpl<'c, 'm> Open<DecryptionKey, RawCiphertext<'c>, RawPlaintext<'m>, Randomness> for Paillier
impl<'c, 'm> Open<DecryptionKey, RawCiphertext<'c>, RawPlaintext<'m>, Randomness> for Paillier
sourcefn open(
dk: &DecryptionKey,
c: RawCiphertext<'c>
) -> (RawPlaintext<'m>, Randomness)
fn open(
dk: &DecryptionKey,
c: RawCiphertext<'c>
) -> (RawPlaintext<'m>, Randomness)
Open ciphertext
c
using key dk
into a plaintext and a randomness.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<EK, C> Rerandomize<EK, C, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c, 'd> Self: Rerandomize<EK, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
impl<EK, C> Rerandomize<EK, C, EncodedCiphertext<Vec<u64, Global>>> for Paillierwhere
for<'c, 'd> Self: Rerandomize<EK, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<Vec<u64>>>,
sourcefn rerandomize(ek: &EK, c: C) -> EncodedCiphertext<Vec<u64>>
fn rerandomize(ek: &EK, c: C) -> EncodedCiphertext<Vec<u64>>
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<EK, C> Rerandomize<EK, C, EncodedCiphertext<u64>> for Paillierwhere
for<'c, 'd> Self: Rerandomize<EK, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
impl<EK, C> Rerandomize<EK, C, EncodedCiphertext<u64>> for Paillierwhere
for<'c, 'd> Self: Rerandomize<EK, RawCiphertext<'c>, RawCiphertext<'d>>,
C: Borrow<EncodedCiphertext<u64>>,
sourcefn rerandomize(ek: &EK, c: C) -> EncodedCiphertext<u64>
fn rerandomize(ek: &EK, c: C) -> EncodedCiphertext<u64>
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<'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 moreAuto Trait Implementations
impl RefUnwindSafe for Paillier
impl Send for Paillier
impl Sync for Paillier
impl Unpin for Paillier
impl UnwindSafe for Paillier
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