Struct diem_sdk::crypto::x25519::x25519_dalek::StaticSecret [−][src]
pub struct StaticSecret(_);
Expand description
A Diffie-Hellman secret key that can be used to compute multiple SharedSecret
s.
This type is identical to the EphemeralSecret
type, except that the
StaticSecret::diffie_hellman
method does not consume the secret key, and the type provides
serialization methods to save and load key material. This means that the secret may be used
multiple times (but does not have to be).
Some protocols, such as Noise, already handle the static/ephemeral distinction, so the
additional guarantees provided by EphemeralSecret
are not helpful or would cause duplicate
code paths. In this case, it may be useful to
use x25519_dalek_fiat::StaticSecret as SecretKey;
since the only difference between the two is that StaticSecret
does not enforce at
compile-time that the key is only used once.
Implementations
Perform a Diffie-Hellman key agreement between self
and
their_public
key to produce a SharedSecret
.
Generate an x25519 key.
Trait Implementations
Given an x25519 StaticSecret
key, compute its corresponding PublicKey
.
Auto Trait Implementations
impl RefUnwindSafe for StaticSecret
impl Send for StaticSecret
impl Sync for StaticSecret
impl Unpin for StaticSecret
impl UnwindSafe for StaticSecret
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more