Expand description
Algorithm-selected dispatch: keygen, sign/verify, key agreement, KEM, AEAD,
hashing, and multikey binding routed by an core::Algorithm selector.
Structs§
- Aead
Params - Borrowed AEAD inputs. Key and nonce lengths are validated by the selected algorithm’s typed constructors at dispatch time, so a wrong length fails closed with a typed error instead of being truncated or padded.
- Generated
Keypair - A generated keypair together with the multikey-encoded public key.
- MacParams
- Borrowed HMAC inputs. The selected algorithm validates key and tag lengths before authenticating so callers cannot accidentally compare truncated tags.
Enums§
- Algorithm
Error - Error returned by algorithm dispatch operations.
Functions§
- aead_
decrypt - Decrypt and authenticate
ciphertext || tagwith the selected AEAD. The returned plaintext is zeroized on drop. - aead_
encrypt - Encrypt
plaintextwith the selected AEAD. Returnsciphertext || tag. - derive_
shared_ secret - Derive a Diffie–Hellman shared secret. The returned secret zeroizes on drop.
- generate_
keypair - Generate a raw keypair for the given algorithm.
- generate_
multikey_ keypair - Generate a keypair and multikey-encode the public key
- hash_
digest - Compute a digest using the selected hash algorithm.
- kem_
decapsulate - Decapsulate a KEM ciphertext. The returned shared secret zeroizes on drop.
- kem_
encapsulate - Returns (shared_secret, ciphertext); the shared secret zeroizes on drop.
- mac_
authenticate - Computes a MAC tag using the selected MAC algorithm.
- mac_
verify - Verifies a MAC tag using the selected MAC algorithm.
- public_
key_ to_ multikey - Multicodec/multikey-encode a public key, canonicalizing P-256 to its
compressed SEC1 form. Returns the
z-prefixed multikey string. - sign
- Sign
msgwithsecretunder the selected signature algorithm, returning the detached signature bytes. - validate_
verification_ method_ multikey - Structural validation of a typed public-key binding.
- verify
- Verify a detached signature.