logo
pub struct EphemeralSecret<C> where
    C: Curve + ProjectiveArithmetic
{ /* private fields */ }
This is supported on crate feature ecdh only.
Expand description

Ephemeral Diffie-Hellman Secret.

These are ephemeral “secret key” values which are deliberately designed to avoid being persisted.

To perform an ephemeral Diffie-Hellman exchange, do the following:

⚠️ SECURITY WARNING ⚠️

Ephemeral Diffie-Hellman exchanges are unauthenticated and without a further authentication step are trivially vulnerable to man-in-the-middle attacks!

These exchanges should be performed in the context of a protocol which takes further steps to authenticate the peers in a key exchange.

Implementations

Generate a cryptographically random EphemeralSecret.

Get the public key associated with this ephemeral secret.

The compress flag enables point compression.

Compute a Diffie-Hellman shared secret from an ephemeral secret and the public key of the other participant in the exchange.

Trait Implementations

Executes the destructor for this type. Read more

Performs the conversion.

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. 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

Performs the conversion.

Performs the conversion.

Should always be Self

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.