A private key: 32 secret bytes, clamped as RFC 7748 §5 describes each
time they are used.
Constructors
generate
Returns a new private key from Random::Secure.
SourceKeeps a copy of secret (32 bytes).
SourceInstance methods
public_key
Returns the matching public key, X25519(secret, 9).
Sourceshared_secret(peer :
PublicKey) :
Bytes |
Nil Returns the 32-byte shared secret with peer, or nil when it is
all zero, which happens only when the peer sent a point of small
order (RFC 7748 §6.1; RFC 9846 §7.4.2 requires the check).
Sourceto_slice
Returns a copy of the private key's 32 bytes.
Source