ic-hash 0.2.1

SHA-2, SHA-3, and SHAKE implementations for IronCrypto
Documentation

ic-hash — FIPS 180-4 and FIPS 202 hash functions

Pure-Rust, no_std, allocation-free implementations of the SHA-2 and SHA-3 families plus the SHAKE extendable-output functions.

use ic_hash::Sha256;
use ic_core::traits::Digest;

let d = Sha256::digest(b"abc");
assert_eq!(
    ic_core::codec::hex(d.as_ref()),
    "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
);

Every type here implements [ic_core::traits::Digest] (or [ic_core::traits::Xof]) and [ic_core::traits::SelfTest], so ic-fips can drive their known-answer tests generically.