Struct safe_zk_token_sdk::encryption::elgamal::ElGamal
source · pub struct ElGamal;
Expand description
Algorithm handle for the twisted ElGamal encryption scheme
Implementations§
source§impl ElGamal
impl ElGamal
sourcepub fn encode<T: Into<Scalar>>(amount: T) -> ElGamalCiphertext
pub fn encode<T: Into<Scalar>>(amount: T) -> ElGamalCiphertext
On input an amount, the function returns a twisted ElGamal ciphertext where the associated Pedersen opening is always zero. Since the opening is zero, any twisted ElGamal ciphertext of this form is a valid ciphertext under any ElGamal public key.