Function elgamal::encrypt

source ·
pub fn encrypt(
    enc_key: P256Point,
    message: Plaintext,
    randomness: &mut Randomness
) -> Result<Ciphertext, Error>
Expand description

To encrypt a message (a group element) under encryption key ek, the encryption key randomized by scalar muliplication with randomizer. The result is used as a blinding element by adding it to the message using the group operation. To allow for decryption, the ciphertext also includes as an auxillary component the result of scalar multiplication of the generator by the randomizer that was used in the blinding.