1pub mod registry;
4pub mod traits;
5pub mod types;
6pub mod validate;
7
8pub use types::{Error, Result};
10
11pub use validate as validation;
13
14#[cfg(feature = "std")]
16impl From<std::array::TryFromSliceError> for Error {
17 fn from(_: std::array::TryFromSliceError) -> Self {
18 Self::InvalidLength {
19 context: "array conversion",
20 expected: 0, actual: 0, }
23 }
24}
25
26#[cfg(feature = "std")]
27impl From<std::io::Error> for Error {
28 fn from(e: std::io::Error) -> Self {
29 Self::Other {
30 context: "I/O operation",
31 message: e.to_string(),
32 }
33 }
34}
35
36#[cfg(feature = "std")]
37use std::error::Error as StdError;
38
39#[cfg(feature = "std")]
41impl StdError for Error {}
42
43pub type CipherResult<T> = Result<T>;
45pub type HashResult<T> = Result<T>;
46pub type KeyResult<T> = Result<T>;
47pub type SignatureResult<T> = Result<T>;