pub struct PaillierPK { /* private fields */ }
Expand description

Public key for the Paillier cryptosystem.

Trait Implementations

‘Enriches’ a ciphertext by associating it with a corresponding public key. This allows to overlead operators for homomorphic operations.

Formats the value using the given formatter. Read more

Decrypts a rich Paillier ciphertext using the secret key.

println!("The decrypted message is {}", secret_key.decrypt(&ciphertext));
// Prints: "The decrypted message is 5".

Decrypt the associated ciphertext using the secret key.

Encrypts a plaintext integer using the Paillier public key.

let ciphertext = public_key.encrypt(&Integer::from(5), &mut rng);

Input is the type used to multiply additive ciphertexts or exponentiate multiplicative ciphertexts.

The type of the plaintext to be encrypted.

The type of an encrypted plaintext, i.e. a ciphertext.

Encrypt the plaintext using the public key and a cryptographic RNG and immediately associate it with the public key.

Combines two ciphertexts so that their decrypted value reflects some addition operation

Applies some operation on a ciphertext so that the decrypted value reflects some multiplication with input

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Casts the value.

Casts the value.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Casts the value.

OverflowingCasts the value.

Should always be Self

Casts the value.

Casts the value.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

UnwrappedCasts the value.

Casts the value.

WrappingCasts the value.