lib-q-keccak 0.0.2

Pure Rust implementation of the Keccak sponge function including the keccak-f and keccak-p variants for lib-Q
docs.rs failed to build lib-q-keccak-0.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

lib-Q Keccak: Quantum-Resistant Cryptographic Sponge Function

crate Docs Build Status Apache 2.0 Licensed Rust Version

Pure Rust implementation of the Keccak Sponge Function including the keccak-f and keccak-p variants for the lib-Q post-quantum cryptography library.

Documentation

About

This crate implements the core Keccak sponge function, a foundational building block for post-quantum cryptographic primitives. Keccak was designed by Guido Bertoni, Joan Daemen, Michaƫl Peeters, and Gilles Van Assche, and forms the basis of the SHA-3 cryptographic hash algorithms standardized in FIPS 202.

For high-level SHA-3 hash functions and SHAKE XOFs, see the lib-q-sha3 crate, which is built on this crate.

See the lib-Q workspace README for how Keccak/SHA-3 crates connect to ML-DSA (lib-q-ring, lib-q-sha3).

Features

  • no_std compatible: Works in embedded and WebAssembly environments
  • Optimized implementations: Platform-specific optimizations for ARM64 and x86_64
  • SIMD support: Parallel processing with portable SIMD (nightly)
  • Multi-threading: Concurrent state processing for high-performance applications
  • WebAssembly: Full WASM support with JavaScript interop via wasm-bindgen
  • Quantum-resistant: Part of the lib-Q post-quantum cryptography suite

Usage

Add this to your Cargo.toml:

[dependencies]

lib-q-keccak = "0.0.2"

Basic Example

use lib_q_keccak::f1600;

let mut state = [0u64; 25];
f1600(&mut state);

With Features

[dependencies]

lib-q-keccak = { version = "0.0.2", features = ["simd", "multithreading"] }

Feature Flags

  • std (default): Enable standard library support
  • asm (default): Use optimized assembly when available
  • alloc: Enable allocator support for no_std environments
  • simd: Enable SIMD parallel processing (requires nightly)
  • multithreading: Enable multi-threaded processing
  • wasm: WebAssembly support with JS interop
  • wasm_getrandom: WASM random number generation support
  • arm64_sha3: ARM64 SHA3 hardware acceleration (native builds only)

Minimum Supported Rust Version

Rust 1.89 or higher.

SemVer Policy

  • All on-by-default features of this library are covered by SemVer
  • MSRV is considered exempt from SemVer as noted above

License

Licensed under Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0).

Contribution

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