Skip to main content

Module block_api

Module block_api 

Source
Expand description

Block-level types and Keccak cores for advanced composition (e.g. K12). Most callers should use the crate-root types. Low-level Keccak / SHA-3 core state and cSHAKE cores re-exported for composition.

  • SpongeHasherCore: generic sponge core (rate, output width, padding nibble, round count) backing SHA-3, SHAKE, cSHAKE, TurboSHAKE in this crate; pre-FIPS Keccak digests use the same core via lib-q-keccak-digest.
  • SpongeReaderCore: XOF output phase for Keccak-based XOFs.
  • CShake128Core / CShake256Core (re-exported from the cshake module): cSHAKE without the buffer_xof! wrapper—only needed for trees or custom plumbing.

For normal hashing, use the crate-root types (Sha3_256, Shake128, CShake128) or the separate lib-q-k12 crate for KangarooTwelve. Manipulating cores directly is a hazmat-style API: incorrect padding or rate breaks security.

Re-exports§

pub use crate::cshake::CShake128Core;
pub use crate::cshake::CShake256Core;

Structs§

SpongeHasherCore
Sponge (Keccak-p) hasher core: rate, output width, padding nibble, round count.
SpongeReaderCore
Core Sha3 XOF reader.

Constants§

KECCAK_DIGEST_PAD
Pre-FIPS Keccak padding nibble for raw Keccak fixed digests (not FIPS 202 SHA-3 padding). Used by the lib-q-keccak-digest crate with SpongeHasherCore; do not substitute SHA-3 padding in protocols.