Module sha384
Available on crate feature
dep_orion
only.Expand description
SHA384 as specified in the FIPS PUB 180-4.
§Parameters:
data
: The data to be hashed.
§Errors:
An error will be returned if:
finalize()
is called twice without areset()
in between.update()
is called afterfinalize()
without areset()
in between.
§Panics:
A panic will occur if:
- More than 2*(2^64-1) bits of data are hashed.
§Security:
- SHA384 is vulnerable to length extension attacks.
§Recommendation:
- It is recommended to use BLAKE2b when possible.
§Example:
use orion::hazardous::hash::sha2::sha384::Sha384;
// Using the streaming interface
let mut state = Sha384::new();
state.update(b"Hello world")?;
let hash = state.finalize()?;
// Using the one-shot function
let hash_one_shot = Sha384::digest(b"Hello world")?;
assert_eq!(hash, hash_one_shot);
Structs§
Constants§
- SHA384_
BLOCKSIZE - The blocksize for the hash function SHA384.
- SHA384_
OUTSIZE - The output size for the hash function SHA384.