A private key: a secret scalar d in [1, n - 1].
Constructors
generate
Returns a new key drawn from Random::Secure by rejection sampling
(FIPS 186-5 Appendix A.2.2).
SourceKeeps a copy of the big-endian scalar scalar. Raises
KeySizeMismatch for the wrong length and InvalidPrivateKey
for zero or a value not below n.
SourceInstance methods
shared_secret(peer :
PublicKey) :
Bytes Returns the ECDH shared secret with peer: the x coordinate of
[d]Q, Arithmetic::BYTESIZE big-endian bytes (SEC 1 §3.3.1;
RFC 9846 §7.4.2). peer was checked to be on the curve when it
was decoded, and the group has prime order, so the result is never
the point at infinity.
Sourceto_slice
Returns a copy of the big-endian scalar.
Source