pub struct CurveElGamalPK {
    pub point: RistrettoPoint,
}
Expand description

Encryption key for curve-based ElGamal

Fields

point: RistrettoPoint

Public key as a RistrettoPoint

Implementations

Precompute values for the encryption key to speed-up future encryptions

Trait Implementations

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Decrypt the ciphertext using the secret key and its related public key.

Returns true if the encrypted value equals the identity. This is typically faster than a full decryption.

Decrypt the associated ciphertext using the secret key.

Returns true if the associated ciphertext encrypts the identity. This is typically faster than a full decryption.

Combine $t$ decryption shares belonging to distinct partial keys to finish decryption. It is the responsibility of the programmer to supply the right number of decryption shares to this function. Read more

Combine $t$ decryption shares belonging to distinct partial keys to finish decryption. It is the responsibility of the programmer to supply the right number of decryption shares to this function. Read more

Deserialize this value from the given Serde deserializer. Read more

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.

The type of the randomness used.

WARNING: This is not a full encryption. The resulting ciphertext is completely insecure. ‘Encrypts’ the plaintext using the public key deterministically, essentially creating a trivial ciphertext. The encryption is not secure until you call randomize or randomize_with with suitable randomness.

Randomizes the ciphertext with the supplied rng.

Randomizes the ciphertext with the user supplied randomness.

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

Encrypt the plaintext using the public key and a cryptographic RNG.

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

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

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

Combines two ciphertexts so that their decrypted value reflects some subtract operation with a constant

The type of the decryption share. If enough decryption shares of different keys are combined, they output the correct decryption.

Partially decrypts a ciphertext, returning a valid decryption share.

Partially decrypts a ciphertext, returning a valid decryption share.

The type of the decryption share. If enough decryption shares of different keys are combined, they output the correct decryption.

Partially decrypts a ciphertext, returning a valid decryption share.

Partially decrypts a ciphertext, returning a valid decryption share.

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Serialize this value into the given Serde serializer. Read more

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.

Casts the value.

Should always be Self

Casts the value.

Casts the value.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

Casts the value.

Casts the value.

Casts the value.