#[non_exhaustive]pub enum Error {
WeakSharedSecret,
KeyDerivation,
Decrypt,
OutOfOrder,
SequenceExhausted,
MalformedFrame,
}Expand description
Errors produced by the sealed channel.
This crate never panics on attacker-controlled input; every fallible operation returns one of these variants instead.
Note: this type intentionally does not implement std::error::Error
because the crate is #![no_std].
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
The supplied Diffie-Hellman shared secret is all-zero.
X25519 produces an all-zero output for low-order points (RFC 7748), which would make the resulting keys predictable; such a secret is rejected with a constant-time check.
KeyDerivation
The HKDF key-derivation step failed (e.g. an expand length error).
Decrypt
AEAD decryption (authentication) failed: the frame was tampered with, the keys do not match, or the nonce/AAD did not correspond.
OutOfOrder
A frame arrived with a sequence number other than the next expected one (replay or reordering).
SequenceExhausted
The 64-bit sequence counter is exhausted. The channel fails closed rather than wrapping or reusing a nonce.
MalformedFrame
A frame was too short, or did not begin with the expected magic byte.