Skip to main content

Crate sha3

Crate sha3 

Source
Expand description

SHA-3 Hash Functions

This crate provides portable, pure Rust implementations of the SHA-3 hashing functions standardized in FIPS 202.

§Limitations

This software is intended as a learning exercise and not for production use.

Performance has thus far not been a priority. This implementation is likely orders of magnitude slower than optimized ones.

We currently only expose functions to hash a complete byte slice &[u8]. Individual bits or multiple inputs that update the hash are currently not supported.

We currently do not implement the SHAKE extendable-output functions described in FIPS 202.

§Example Usage

let message = b"your input bytes";
let hash: [u8; 32] = sha3_256(message);
let expected = "414d4b6d11a92aaeeebe35f9374942f563848d345631bf5537407252dca6b378";
assert_eq!(expected, hex::encode(hash))

Functions§

sha3_224
SHA-3 Hash with 224 bits (28 bytes) output.
sha3_256
SHA-3 Hash with 256 bits (32 bytes) output.
sha3_384
SHA-3 Hash with 384 bits (48 bytes) output.
sha3_512
SHA-3 Hash with 512 bits (64 bytes) output.