Expand description
Pure Rust hash function implementations for the OxiCrypto stack.
Provides Hash-trait wrappers and StreamingHash adapters for:
- SHA-2: SHA-256, SHA-384, SHA-512, SHA-512/256 (FIPS 180-4)
- SHA-3: SHA3-256, SHA3-384, SHA3-512 (FIPS 202)
- BLAKE2: BLAKE2b-256, BLAKE2b-512, BLAKE2s-256 (RFC 7693)
- BLAKE3: standard, keyed-hash, key-derivation, XOF (blake3 spec)
- SHAKE128/256, cSHAKE128/256, TupleHash128/256 (NIST SP 800-185)
- BLAKE2b keyed-hash mode (RFC 7693 MAC mode)
All streaming adapters implement StreamingHash via the generic
DigestStreamingAdapter wrapper which works with any digest::Digest + Default type.
Structs§
- Blake3
- BLAKE3 hash function (32-byte output by default).
- Blake2b256
- BLAKE2b-256 hash function (32-byte output, RFC 7693).
- Blake2b512
- BLAKE2b-512 hash function (64-byte output, RFC 7693).
- Blake2b
Keyed - BLAKE2b keyed-hash (MAC mode), with variable output size 1–64 bytes.
- Blake2s256
- BLAKE2s-256 hash function (32-byte output, RFC 7693).
- Blake3
Keyed - BLAKE3 keyed-hash (MAC-like): deterministic 32-byte output under a 32-byte key.
- Blake3
Streaming - Streaming BLAKE3 hasher (32-byte output).
- Digest
Streaming Adapter - Generic streaming adapter wrapping any
digest::Digest + Defaulttype. - Hash
Builder - Fluent builder producing a boxed one-shot
Hashinstance. - Parallel
Hash128 - ParallelHash128 configured with a block size and customization string.
- Parallel
Hash256 - ParallelHash256 configured with a block size and customization string.
- Sha3_
256 - SHA3-256 hash function (32-byte output, FIPS 202).
- Sha3_
384 - SHA3-384 hash function (48-byte output, FIPS 202).
- Sha3_
512 - SHA3-512 hash function (64-byte output, FIPS 202).
- Sha256
- SHA-256 hash function (32-byte output, FIPS 180-4 §6.2).
- Sha384
- SHA-384 hash function (48-byte output, FIPS 180-4 §6.5).
- Sha512
- SHA-512 hash function (64-byte output, FIPS 180-4 §6.4).
- Sha512_
256 - SHA-512/256 truncated hash function (32-byte output, FIPS 180-4 §6.7).
- Shake128
Reader - SHAKE128 XOF reader: stream an arbitrary number of output bytes from a finalised SHAKE128 state.
- Shake256
Reader - SHAKE256 XOF reader: stream an arbitrary number of output bytes from a finalised SHAKE256 state.
- Streaming
Hash Builder - Fluent builder producing a
DynStreamingHashinstance.
Enums§
- DynStreaming
Hash - Runtime-dispatched streaming hasher returned by
StreamingHashBuilder::build. - Hash
Algorithm - Hash algorithm selector used by
HashBuilder.
Functions§
- blake2b_
keyed - Hash
msgunderkeywith BLAKE2b in keyed mode; output is written toout. - blake3_
derive_ key - Derive a 32-byte key using BLAKE3 key-derivation mode.
- blake3_
keyed_ hash - Hash
msgunderkeywith BLAKE3 keyed-hash mode; returns 32 bytes. - blake3_
xof - Hash
msgwith BLAKE3 and returnoutput_lenbytes. - cshake128
- Hash
msgwith cSHAKE128 (NIST SP 800-185 §3) and fillout. - cshake256
- Hash
msgwith cSHAKE256 (NIST SP 800-185 §3) and fillout. - parallel_
hash128 - ParallelHash128 with fixed output length (NIST SP 800-185 §6.1).
- parallel_
hash256 - ParallelHash256 with fixed output length (NIST SP 800-185 §6.2).
- parallel_
hash128_ xof - ParallelHash128 in extendable-output (XOF) mode (NIST SP 800-185 §6.3).
- parallel_
hash256_ xof - ParallelHash256 in extendable-output (XOF) mode (NIST SP 800-185 §6.3).
- shake128
- Hash
msgwith SHAKE128 and filloutwith extendable output. - shake256
- Hash
msgwith SHAKE256 and filloutwith extendable output. - shake128_
start - Begin a SHAKE128 computation, returning a finalisable hasher.
- shake256_
start - Begin a SHAKE256 computation, returning a finalisable hasher.
- tuple_
hash128 - TupleHash128 (NIST SP 800-185 §5).
- tuple_
hash256 - TupleHash256 (NIST SP 800-185 §5).
Type Aliases§
- Blake2b256
Streaming - Streaming BLAKE2b-256 hasher (32-byte output).
- Blake2b512
Streaming - Streaming BLAKE2b-512 hasher (64-byte output).
- Blake2s256
Streaming - Streaming BLAKE2s-256 hasher (32-byte output).
- Sha3_
256Streaming - Streaming SHA3-256 hasher.
- Sha3_
384Streaming - Streaming SHA3-384 hasher.
- Sha3_
512Streaming - Streaming SHA3-512 hasher.
- Sha256
Streaming - Streaming SHA-256 hasher.
- Sha384
Streaming - Streaming SHA-384 hasher.
- Sha512
Streaming - Streaming SHA-512 hasher.
- Sha512_
256Streaming - Streaming SHA-512/256 hasher.