Module sha3_256
Available on crate feature
dep_orion
only.Expand description
SHA3-256 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_256::Sha3_256;
// Using the streaming interface
let mut state = Sha3_256::new();
state.update(b"Hello world")?;
let hash = state.finalize()?;
// Using the one-shot function
let hash_one_shot = Sha3_256::digest(b"Hello world")?;
assert_eq!(hash, hash_one_shot);
Structs§
Constants§
- SHA3_
256_ OUTSIZE - Output size of SHA3-256 in bytes.
- SHA3_
256_ RATE - Rate of SHA3-256 (equivalent to blocksize in SHA2).