lms_signature/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! Error types

// TODO: review errors and make sure they are appropriate
// I expect it does not make sense to use a single error type for both
// LMS and OTS parsing, as we are currently doing.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
/// The error returned by `TryFrom<&[u8]>` impls
pub enum LmsDeserializeError {
    /// Length of the slice was `< 4` and no algorithm can be parsed
    NoAlgorithm,
    /// The parsed algorithm does not match the requested deserialization
    WrongAlgorithm,
    /// The slice did not contain enough data
    TooShort,
    /// The slice contained too much data
    TooLong,
    /// The parsed `q` value was too large
    InvalidQ,
}