[][src]Module x25519_dalek::x25519

x25519 Diffie-Hellman key exchange

This implements x25519 key exchange as specified by Mike Hamburg and Adam Langley in RFC7748.

Structs

AllowUnreducedScalarBytes

Derived serialization methods will not work on a StaticSecret because x25519 requires non-canonical scalars which are rejected by curve25519-dalek. Thus we provide a way to convert the bytes directly to a scalar using Serde's remote derive functionality.

EphemeralSecret

A EphemeralSecret is a short lived Diffie-Hellman secret key used to create a SharedSecret when given their PublicKey.

PublicKey

A PublicKey is the corresponding public key converted from an EphemeralSecret or a StaticSecret key.

SharedSecret

A SharedSecret is a Diffie-Hellman shared secret that’s generated from your EphemeralSecret or StaticSecret and their PublicKey.

StaticSecret

A StaticSecret is a static Diffie-Hellman secret key that can be saved and loaded to create a SharedSecret when given their PublicKey.

Constants

X25519_BASEPOINT_BYTES

The X25519 basepoint, for use with the bare, byte-oriented x25519 function. This is provided for people who cannot use the typed DH API for some reason.

_DERIVE_Drop_FOR_EphemeralSecret
_DERIVE_Drop_FOR_SharedSecret
_DERIVE_Drop_FOR_StaticSecret
_DERIVE_zeroize_Zeroize_FOR_EphemeralSecret
_DERIVE_zeroize_Zeroize_FOR_SharedSecret
_DERIVE_zeroize_Zeroize_FOR_StaticSecret

Functions

clamp_scalar

"Decode" a scalar from a 32-byte array.

x25519

The bare, byte-oriented x25519 function, exactly as specified in RFC7748.