This crate provides traits which describe functionality of cryptographic hash functions and Message Authentication algorithms.
Traits in this repository are organized into the following levels:
- High-level convenience traits:
Mac. Wrappers around lower-level traits for most common use-cases. Users should usually prefer using these traits.
- Mid-level traits:
InnerInit. These traits atomically describe available functionality of an algorithm.
- Marker traits:
MacMarker. Used to distinguish different algorithm classes.
- Low-level traits defined in the
core_apimodule. These traits operate at a block-level and do not contain any built-in buffering. They are intended to be implemented by low-level algorithm providers only. Usually they should not be used in application-level code.
Additionally hash functions implement traits from the standard library:
Write. The latter is
std feature, which is usually enabled by default
by hash implementation crates.
pub use crypto_common::rand_core;
pub use block_buffer;
pub use const_oid;
pub use crypto_common;
pub use crypto_common::generic_array;
pub use crypto_common::typenum;
- Type aliases for many constants.
core-apiLow-level traits operating on blocks and wrappers around them.
core-apiImplement dummy type with hidden docs which is used to “carry” hasher OID for
macDefine MAC test
macDefine resettable MAC test
devDefine hash function test
macFixed size output value which provides a safe
Eqimplementation that runs in constant time.
- Buffer length is not equal to hash output size.
- The error type used in variable hash traits.
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
- Modification of the
Digesttrait suitable for trait objects.
- Trait for hash functions with extendable-output (XOF).
- Trait for hash functions with extendable-output (XOF) able to reset themselves.
- Trait for hash functions with fixed-size output.
- Trait for hash functions with fixed-size output able to reset themselves.
- Marker trait for cryptographic hash functions.
- Types which can be initialized from another type (usually block ciphers).
- Types which can be initialized from key.
macConvenience wrapper trait covering functionality of Message Authentication algorithms.
macMarker trait for Message Authentication algorithms.
- Types which return data with the given size.
- Resettable types.
- Types which consume data with byte granularity.
- Trait for hash functions with variable-size output.
- Trait for hash functions with variable-size output able to reset themselves.
- Trait for reader types which are used to extract extendable output from a XOF (extendable-output function) result.