Struct paillier::RawCiphertext
source · Expand description
Encrypted message without type information.
Used mostly for internal purposes and advanced use-cases.
Tuple Fields
0: Cow<'b, 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<'b> Clone for RawCiphertext<'b>
impl<'b> Clone for RawCiphertext<'b>
sourcefn clone(&self) -> RawCiphertext<'b>
fn clone(&self) -> RawCiphertext<'b>
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<'b> Debug for RawCiphertext<'b>
impl<'b> Debug for RawCiphertext<'b>
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, '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<'b> From<&'b BigInt> for RawCiphertext<'b>
impl<'b> From<&'b BigInt> for RawCiphertext<'b>
sourceimpl<'b> From<BigInt> for RawCiphertext<'b>
impl<'b> From<BigInt> for RawCiphertext<'b>
sourceimpl<'b> From<RawCiphertext<'b>> for BigInt
impl<'b> From<RawCiphertext<'b>> for BigInt
sourcefn from(x: RawCiphertext<'b>) -> Self
fn from(x: RawCiphertext<'b>) -> 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<'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<'b> PartialEq<RawCiphertext<'b>> for RawCiphertext<'b>
impl<'b> PartialEq<RawCiphertext<'b>> for RawCiphertext<'b>
sourcefn eq(&self, other: &RawCiphertext<'b>) -> bool
fn eq(&self, other: &RawCiphertext<'b>) -> bool
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 moreimpl<'b> StructuralPartialEq for RawCiphertext<'b>
Auto Trait Implementations
impl<'b> RefUnwindSafe for RawCiphertext<'b>
impl<'b> Send for RawCiphertext<'b>
impl<'b> Sync for RawCiphertext<'b>
impl<'b> Unpin for RawCiphertext<'b>
impl<'b> UnwindSafe for RawCiphertext<'b>
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