pub struct SecretKey<G: Group>(_);
Expand description

Secret key for ElGamal encryption and related protocols. This is a thin wrapper around the Group scalar.

Implementations

Decrypts the provided ciphertext and returns the produced group element.

As the ciphertext does not include a MAC or another way to assert integrity, this operation cannot fail. If the ciphertext is not produced properly (e.g., it targets another receiver), the returned group element will be garbage.

Decrypts the provided ciphertext and returns the original encrypted value.

lookup_table is used to find encrypted values based on the original decrypted group element. That is, it must contain all valid plaintext values. If the value is not in the table, this method will return None.

Generates a random secret key.

Deserializes a secret key from bytes. If bytes do not represent a valid scalar, returns None.

Exposes the scalar equivalent to this key.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Executes the destructor for this type. Read more

Converts to this type from the input type.

Converts to this type from the input type.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Serialize this value into the given Serde serializer. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

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.