mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-02-14 19:03:05 +00:00
27 lines
575 B
Rust
27 lines
575 B
Rust
|
|
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,
|
||
|
|
}
|