use core::fmt;
#[derive(Debug)]
pub enum PakeError {
InvalidPoint,
IdentityPoint,
InvalidInput(&'static str),
ProtocolError(&'static str),
}
impl fmt::Display for PakeError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
PakeError::InvalidPoint => write!(f, "invalid point encoding"),
PakeError::IdentityPoint => write!(f, "identity point encountered"),
PakeError::InvalidInput(msg) => write!(f, "invalid input: {msg}"),
PakeError::ProtocolError(msg) => write!(f, "protocol error: {msg}"),
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for PakeError {}