Expand description
Pure Rust implementation of the Keccak sponge function.
This crate provides low-level Keccak permutation functions (keccak-f and keccak-p variants).
For high-level SHA-3 hash functions, see lib-q-sha3.
§Features
- no_std compatible: Works in embedded and WASM environments
- Optimized implementations: Platform-specific optimizations for ARM64 and x86_64
- SIMD support: Parallel processing with portable SIMD
- Multi-threading: Concurrent state processing for high-performance applications
- WebAssembly: Full WASM support with JavaScript interop
§Example
// Test vectors are from KeccakCodePackage
let mut data = [0u64; 25];
lib_q_keccak::f1600(&mut data);§Configuration
To disable loop unrolling (e.g. for constraint targets) use the no_unroll feature.
Modules§
- advanced
- Advanced SIMD optimizations using nightly features
- detection
- Runtime feature detection utilities
- parallel
- Parallel processing interface for batch operations
- simd
- SIMD implementations for Keccak-f1600 sponge function
- simd_
parallel - Parallel Keccak-p[1600] processing functions
Macros§
Structs§
- Crypto
Thread Pool - Thread-safe cryptographic thread pool
- Feature
Config - Runtime feature detection and configuration
- Feature
Report - Comprehensive feature availability report
- Simd
Config - SIMD processing configuration for security and performance tuning
- Simd
Security Validator - SIMD state validation and security checks
- Threading
Config - Thread-safe configuration for multi-threading operations
- Worker
Stats - Worker statistics for monitoring and debugging
Enums§
- Affinity
Strategy - Thread affinity strategy for optimizing cache performance
- Optimization
Level - Platform-specific optimization selector
Traits§
- Advanced
Lane Size - Advanced SIMD lane size trait for secure parallel processing
- Lane
Size - Keccak is a permutation over an array of lanes which comprise the sponge construction.
Functions§
- f200
- Keccak-f sponge function
- f400
- Keccak-f sponge function
- f800
- Keccak-f sponge function
- f1600
- Keccak-f sponge function
- fast_
loop_ absorb_ optimized - Fast loop absorption with automatic optimization selection
- get_
global_ config - Get the global feature configuration.
- get_
global_ thread_ pool - Get the global thread pool instance
- init_
global_ thread_ pool - Initialize the global thread pool (first call wins; later configs are ignored).
- keccak_
p - Generic Keccak-p sponge function
- p200
- Keccak-p sponge function
- p400
- Keccak-p sponge function
- p800
- Keccak-p sponge function
- p1600
- Keccak-p sponge function
- p1600_
multithreaded - Multi-threaded parallel processing for large workloads
- p1600_
optimized - Optimized Keccak-p[1600] permutation with automatic optimization selection
- p1600x4
- Apply Keccak-p[1600,
round_count] to four independent states at once. - p1600x8
- Apply Keccak-p[1600,
round_count] to eight independent states at once. - process_
keccak_ states_ global - Process Keccak states using the global thread pool
- reset_
global_ config - Reset the global feature configuration to its unset state.
- set_
global_ config - Set the global feature configuration.