30 lines
642 B
Rust
Raw Normal View History

2026-01-15 08:47:02 +08:00
use thiserror::Error;
/// Errors produced by the Double Ratchet protocol
#[derive(Debug, Error, Clone, PartialEq, Eq)]
pub enum RatchetError {
#[error("ciphertext too short")]
CiphertextTooShort,
#[error("invalid nonce")]
InvalidNonce,
#[error("decryption failed")]
DecryptionFailed,
#[error("message replay detected")]
MessageReplay,
#[error("too many skipped messages")]
TooManySkippedMessages,
#[error("missing remote DH key")]
MissingRemoteDhKey,
#[error("missing receiving chain")]
MissingReceivingChain,
#[error("deserialization failed")]
DeserializationFailed,
2026-01-15 08:47:02 +08:00
}