pub struct HiddenKey { /* private fields */ }Expand description
A keypair whose public key can be sent as a uniform bit string.
The secret is zeroized on drop. The point and the representative are public values and are not.
Implementations§
Source§impl HiddenKey
impl HiddenKey
Sourcepub const fn point(&self) -> &[u8; 32]
pub const fn point(&self) -> &[u8; 32]
The public point, as a Montgomery u-coordinate. This is what goes into the protocol.
Sourcepub const fn representative(&self) -> &[u8; 32]
pub const fn representative(&self) -> &[u8; 32]
The uniform encoding of point. This is what goes on
the wire.
Sourcepub const fn secret_bytes(&self) -> &[u8; 32]
pub const fn secret_bytes(&self) -> &[u8; 32]
The raw secret scalar, unclamped, for feeding to your own X25519.
With the x25519 feature you can use diffie_hellman instead and skip
handling this at all.
Sourcepub fn static_secret(&self) -> StaticSecret
pub fn static_secret(&self) -> StaticSecret
The secret as an x25519-dalek StaticSecret, for handing to code that
wants to drive the key exchange itself.
Sourcepub fn diffie_hellman(&self, peer: &PublicKey) -> SharedSecret
pub fn diffie_hellman(&self, peer: &PublicKey) -> SharedSecret
Diffie-Hellman against a peer’s public key.
Clamping happens inside x25519-dalek, exactly as for any other X25519
operation — the dirtiness lives in the published point, never in the
scalar arithmetic, which is precisely why the shared secret is unaffected
by it.