1use core::fmt;
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum Error {
6 InvalidParamLen,
8 InvalidRounds,
10 InvalidOutputLen,
12 InvalidMemoryLen,
14}
15
16impl fmt::Display for Error {
17 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
18 match self {
19 Error::InvalidParamLen => write!(f, "Invalid parameter length"),
20 Error::InvalidRounds => write!(f, "Invalid number of rounds"),
21 Error::InvalidOutputLen => write!(f, "Invalid output length"),
22 Error::InvalidMemoryLen => write!(f, "Invalid memory length"),
23 }
24 }
25}
26
27#[cfg(feature = "std")]
28impl std::error::Error for Error {}