Module sha3_512
Available on crate feature
dep_orion
only.Expand description
SHA3-512 as specified in the FIPS PUB 202.
§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.
§Example:
use orion::hazardous::hash::sha3::sha3_512::Sha3_512;
// Using the streaming interface
let mut state = Sha3_512::new();
state.update(b"Hello world")?;
let hash = state.finalize()?;
// Using the one-shot function
let hash_one_shot = Sha3_512::digest(b"Hello world")?;
assert_eq!(hash, hash_one_shot);
Structs§
Constants§
- SHA3_
512_ OUTSIZE - Output size of SHA3-512 in bytes.
- SHA3_
512_ RATE - Rate of SHA3-512 (equivalent to blocksize in SHA2).