RustCrypto: Keccak Sponge Function
Pure Rust implementation of the Keccak Sponge Function including the keccak-f
and keccak-p variants.
About
This crate implements the core Keccak sponge function, upon which many other cryptographic functions are built.
For the SHA-3 family including the SHAKE XOFs, see the sha3 crate, which
is built on this crate.
Examples
// Test vector from KeccakCodePackage
let mut state = ;
new.with_f1600;
Configuration flags
You can modify crate using the following configuration flags:
keccak_backend: select the specified backend. Supported values:aarch64_sha3: AArch64-specific backend based on thesha3extension.simd128/256/512: backend based on the portable SIMD API. Requires Nightly compiler.soft: portable software backend.
keccak_backend_soft="compact": control software backend implementation. Supported values:compact: do not unroll loops. Reduces performance, but results in a more compact binary code.
The flags can be enabled using RUSTFLAGS environment variable
(e.g. RUSTFLAGS='--cfg keccak_backend="soft"') or by modifying .cargo/config.toml.
License
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.