diff options
author | Daniel Schadt <kingdread@gmx.de> | 2023-11-27 17:29:30 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2023-11-27 17:29:30 +0100 |
commit | be9d0e07c3377a13f96363fd8bd7925b3ae17778 (patch) | |
tree | 5c14fcba83bd313bb6973b0fb80b39c61632f1b3 /src/error.rs | |
parent | 5dfb7d4461154d50fb5d88f6c9d0c13d3f767f6d (diff) | |
download | hohibe-be9d0e07c3377a13f96363fd8bd7925b3ae17778.tar.gz hohibe-be9d0e07c3377a13f96363fd8bd7925b3ae17778.tar.bz2 hohibe-be9d0e07c3377a13f96363fd8bd7925b3ae17778.zip |
more documentation
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 155a388..a79b8e0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,13 +1,29 @@ +//! Error definitions for HIBE operations. use thiserror::Error; +/// Type for all errors that can occur when working with the HIBE implementations of this crate. #[derive(Debug, Error)] pub enum Error { + /// Error returned when the identity that was supplied exceeded the given maximum hierarchy + /// depth. + /// + /// Can also be returned when trying to derive a key that would exceed the maximum identity + /// depth. #[error("The supplied identity was too long")] IdentityTooLong, + + /// Error returned when trying to derive the root identity, as there is no parent key for the + /// root. #[error("The supplied identity had no elements")] EmptyIdentity, + + /// Error when the given ciphertext was malformed. + /// + /// Note that this crate does not verify the integrity of ciphertexts. The absence of a + /// malformation therefore does *not* mean that the ciphertext has not been tampered with! #[error("The supplied ciphertext was malforemd")] MalformedCiphertext, } +/// Shortcut for [`std::result::Result`] with [`enum@Error`] as the default error. pub type Result<V, E=Error> = std::result::Result<V, E>; |