Skip to main content

commonware_cryptography/handshake/sake/
error.rs

1use core::ops::Range;
2use thiserror::Error;
3
4/// Errors relating to the handshake.
5#[derive(Error, Debug)]
6pub enum Error {
7    /// A peer's signature does not verify over the transcript.
8    #[error("invalid signature")]
9    InvalidSignature,
10    /// A peer's ephemeral key yields a non-contributory shared secret.
11    #[error("invalid ephemeral key")]
12    InvalidEphemeralKey,
13    /// A peer's confirmation does not match the transcript.
14    #[error("invalid confirmation")]
15    InvalidConfirmation,
16    /// The timestamp is not in the allowable bounds
17    #[error("timestamp {0} not in {1:?}")]
18    InvalidTimestamp(u64, Range<u64>),
19}