Trait fast_paillier::AnyEncryptionKeyExt
source · pub trait AnyEncryptionKeyExt: AnyEncryptionKey {
// Required method
fn encrypt_with_random(
&self,
rng: &mut (impl RngCore + CryptoRng),
x: &Plaintext
) -> Result<(Ciphertext, Nonce), Error>;
}
Expand description
Additional functionality implemented for AnyEncryptionKey
Required Methods§
sourcefn encrypt_with_random(
&self,
rng: &mut (impl RngCore + CryptoRng),
x: &Plaintext
) -> Result<(Ciphertext, Nonce), Error>
fn encrypt_with_random( &self, rng: &mut (impl RngCore + CryptoRng), x: &Plaintext ) -> Result<(Ciphertext, Nonce), Error>
Encrypts the plaintext x
in {-N/2, .., N_2}
Nonce is sampled randomly using rng
.
Returns error if plaintext is not in specified range
Object Safety§
This trait is not object safe.