#keccak #xof #digest #keccak-hash

no-std sha3

Implementation of the SHA-3 family of cryptographic hash algorithms

43 releases

Uses new Rust 2024

0.12.0 May 15, 2026
0.11.0-rc.9 Mar 18, 2026
0.11.0-rc.3 Sep 3, 2025
0.11.0-rc.0 May 29, 2025
0.3.0 Nov 17, 2016

#2170 in Cryptography

Download history 1636312/week @ 2026-04-19 1598458/week @ 2026-04-26 1694673/week @ 2026-05-03 2190381/week @ 2026-05-10 2330957/week @ 2026-05-17 2383014/week @ 2026-05-24 2667894/week @ 2026-05-31 2561155/week @ 2026-06-07 2416640/week @ 2026-06-14 2494925/week @ 2026-06-21 2441656/week @ 2026-06-28 2566315/week @ 2026-07-05 2692587/week @ 2026-07-12 2861327/week @ 2026-07-19 2989052/week @ 2026-07-26 2974521/week @ 2026-08-02

11,779,085 downloads per month
Used in 12,219 crates (1,659 directly)

MIT/Apache

200KB
199 lines

RustCrypto: SHA-3

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Implementation of the SHA-3 family of cryptographic hash algorithms.

There are 4 standard fixed-size algorithms specified in the SHA-3 standard: SHA3-224, SHA3-256, SHA3-384, SHA3-512.

SHAKE128 and SHAKE256 extendable output functions (XOF) are defined in the shake crate

Additionally, this crate supports:

  • Keccak224, Keccak256, Keccak384, Keccak512: NIST submission without padding changes
  • Keccak256Full: CryptoNight variant of SHA-3

Examples

Output size of SHA3-256 is fixed, so its functionality is usually accessed via the Digest trait:

use hex_literal::hex;
use sha3::{Digest, Sha3_256};

let mut hasher = Sha3_256::new();
hasher.update(b"abc");
let hash = hasher.finalize();

assert_eq!(hash, hex!("3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532"));

See the digest crate docs for additional examples.

License

The crate is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~560–760KB
~19K SLoC