mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-02-13 18:33:22 +00:00
* feat: costom encode for double ratchet * chore: correct capacity * chore: refactor reference * chore: reader for parse bytes * chore: extract reader * chore: example with persist state. * chore: update example * chore: implement serde compatibility. * chore: as_bytes * chore: zerorize the secrec material * chore: use as_types to return reference for static key. * chore: extract example from basic demo
30 lines
642 B
Rust
30 lines
642 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,
|
|
|
|
#[error("deserialization failed")]
|
|
DeserializationFailed,
|
|
}
|