Skip to main content

Module ed25519_sign

Module ed25519_sign 

Source
Expand description

Ed25519 signing-key minting (RFC 8032).

Split from ed25519-verify so a provider can serve verification alone. Ed25519 signing is constant-time by construction (no per-signature secret nonce, complete addition laws), so providers in shared timing domains can serve it (see README.md, “Timing-channel policy”).

Signing keys import as PKCS#8 or an OKP private JWK — the platform pass-through formats — and never as a bare seed (see README.md, “Design notes”, the format-admission rule). Imports return only the signing key; the public half is supplied separately via ed25519-verify (there is no derive from a private import).

Functions§

generate_key
Generate a fresh random signing key, returning both halves — the only point at which every provider is guaranteed to have the public key on hand.
import_signing_key_jwk
Import a signing key as an RFC 8037 OKP private JWK (kty: "OKP", crv: "Ed25519", with x and d both required; an alg member, when present, must be "Ed25519" or "EdDSA"). Implementations MAY reject a JWK whose x is not the public key of d, and MUST NOT trust x for any operation. See mac-key.export-key-jwk for the package-wide JWK contract.
import_signing_key_pkcs8
Import a signing key as a PKCS#8 PrivateKeyInfo (DER, RFC 8410: the 32-byte seed in a CurvePrivateKey). Wrong OIDs and malformed DER fail with error.invalid-key.
unwrap_signing_key_jwk
Mint a signing key from unwrapped key material read as an OKP private JWK, subject to import-signing-key-jwk’s contract plus the unwrap-path use/key_ops checks (see README.md, “JWK contract”). input is consumed; see unwrap-signing-key-pkcs8 for the options model.
unwrap_signing_key_pkcs8
Mint a signing key from unwrapped key material (see the wrapping interface): input’s bytes are read as a PKCS#8 PrivateKeyInfo, subject to import-signing-key-pkcs8’s contract. input is consumed.

Type Aliases§

Error
SigningKey
SigningKeyOptions
UnwrapInput
VerifyingKey