use core::fmt;
#[cfg(feature = "std")]
use std::error;
#[derive(Copy, Clone, Debug)]
pub struct LoopError;
impl fmt::Display for LoopError {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.write_str("Loop Error")
}
}
#[cfg(feature = "std")]
impl error::Error for LoopError {
fn description(&self) -> &str {
"stream cipher loop detected"
}
}
#[derive(Copy, Clone, Debug)]
pub struct InvalidKeyNonceLength;
impl fmt::Display for InvalidKeyNonceLength {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.write_str("Loop Error")
}
}
#[cfg(feature = "std")]
impl error::Error for InvalidKeyNonceLength {
fn description(&self) -> &str {
"stream cipher loop detected"
}
}