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:

§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§

Digest
A type to represent the Digest that SHA384 returns.
Sha384
SHA384 streaming state.

Constants§

SHA384_BLOCKSIZE
The blocksize for the hash function SHA384.
SHA384_OUTSIZE
The output size for the hash function SHA384.