use core::fmt;
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum Error {
MalformedSecretKey,
MalformedPublicKey,
InvalidSignature,
InvalidSliceLength,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let msg = match self {
Self::MalformedSecretKey => "Malformed secret key encoding.",
Self::MalformedPublicKey => "Malformed public key encoding.",
Self::InvalidSignature => "Invalid signature.",
Self::InvalidSliceLength => "Invalid length when parsing byte slice.",
};
msg.fmt(f)
}
}
#[cfg(feature = "std")]
impl std::error::Error for Error {}