Expand description
Pre–FIPS Keccak fixed digests: original Keccak padding, not FIPS 202 SHA-3 (use lib_q_sha3 for Sha3_256 and the SHA-3 family).
§Types
Keccak224…Keccak512,Keccak256Full(200-byte output).- One-shot:
keccak_224,keccak_256,keccak_384,keccak_512,keccak_256_full.
§Security
Keccak256and anylib_q_sha3::Sha3_256produce different digests for the same input (different padding).- Do not substitute this crate for SHA-3 in a protocol without explicit specification.
See the crate README for links, architecture ADR, and follow-up dependency extraction ADR.
§lib-q-keccak-digest
Pre–FIPS Keccak fixed-length digests for lib-Q: Keccak224 … Keccak512 and the non-standard Keccak256Full (200-byte output, CryptoNight-style width). This is not FIPS 202 SHA-3—different padding from lib-q-sha3 (Sha3_256, SHAKE, cSHAKE, TurboSHAKE).
- Repository: https://github.com/Enkom-Tech/libQ
- SHA-3 / SHAKE / cSHAKE / TurboSHAKE:
lib-q-sha3 - Keccak-
ppermutation:lib-q-keccak
§Security
Keccak256andSha3_256are different functions (different padding). Do not swap them in a protocol.Keccak256Fullis a 200-byte digest width, not a 32-byte “Keccak-256” hash. Do not treat it likeSha3_256orKeccak256.- This crate is for interoperability with legacy or non-NIST uses of the Keccak sponge with original padding; for new NIST-aligned designs, use SHA-3 and related types from
lib-q-sha3.
§no_std, alloc, and WebAssembly
The crate is #![no_std]. Default features include alloc (via the digest feature) for the usual buffer_fixed! hasher API. The dependency on lib-q-sha3 uses default-features = false so the Keccak permutation does not pull std (for example for thumb* or wasm32-unknown-unknown).
CI cross-checks wasm32-unknown-unknown and thumbv7em-none-eabi for this package. For wasm32-unknown-unknown, match the workspace pattern for getrandom if your binary links crates that use it: set CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS to include --cfg getrandom_backend="wasm_js" (see the k12-no-std-wasm job in .github/workflows/ci.yml).
§License
Apache-2.0; see the workspace LICENSE file.
§Architecture
Non–FIPS-202 digests are isolated here; rationale is ADR 001 in lib-q-sha3. A future slimmer dependency graph (without a full lib-q-sha3 line for every use case) is ADR 002.
Structs§
- Keccak224
- Keccak-224 (original Keccak padding, not SHA3-224).
- Keccak256
- Keccak-256 (original Keccak padding, not SHA3-256).
- Keccak384
- Keccak-384 (original Keccak padding, not SHA3-384).
- Keccak512
- Keccak-512 (original Keccak padding, not SHA3-512).
- Keccak256
Full - Non-standard 200-byte output Keccak-256 (e.g. CryptoNight-style). Not FIPS SHA3-256—see the crate README.
Traits§
- Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
Functions§
- keccak_
224 - One-shot Keccak-224 (original padding; not SHA-3-224).
- keccak_
256 - One-shot Keccak-256 (original padding; not SHA-3-256).
- keccak_
384 - One-shot Keccak-384 (original padding; not SHA-3-384).
- keccak_
512 - One-shot Keccak-512 (original padding; not SHA-3-512).
- keccak_
256_ full - One-shot Keccak256Full (200-byte output, original padding).