pub mod shake;
pub mod sponge;
#[derive(Debug, PartialEq, Eq)]
pub enum Error {
MissingSecurityLevel,
FailedSpongeOperation,
InvalidEntropyLength(usize),
NonNullEntropyLastTrit,
}
impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Error::MissingSecurityLevel => write!(f, "Missing security level in generator."),
Error::FailedSpongeOperation => write!(f, "Failed sponge operation."),
Error::InvalidEntropyLength(length) => {
write!(f, "Invalid entropy length, should be 243 trits, was {0}.", length)
}
Error::NonNullEntropyLastTrit => write!(f, "Last trit of the entropy is not null."),
}
}
}
#[derive(Clone, Copy, Default)]
#[repr(u8)]
pub enum WotsSecurityLevel {
Low = 1,
#[default]
Medium = 2,
High = 3,
}