1use core::fmt;
2
3#[derive(Debug)]
4pub enum OqsError {
5 NotImplemented,
6 InvalidLength,
7 VerifyFail,
8 Internal(&'static str),
9}
10
11impl fmt::Display for OqsError {
12 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13 match self {
14 OqsError::NotImplemented => write!(f, "not implemented (enable `liboqs`)"),
15 OqsError::InvalidLength => write!(f, "invalid length"),
16 OqsError::VerifyFail => write!(f, "verification failed"),
17 OqsError::Internal(m) => write!(f, "internal error: {}", m),
18 }
19 }
20}
21
22impl std::error::Error for OqsError {}