1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Cédric Mesnil <cslashm@pm.me>
// Complete FIPS-algorithm / countermeasure family: with the module now
// crate-internal (API re-tiering, v0.2), not every entry point has an
// in-crate caller in every feature combination. All of them light up under
// --all-features and are exercised by the KAT suites; keeping the full,
// audited family beats pruning it per-combo. Documented allow (CLAUDE.md §6).
//! SHA-3 / SHAKE high-level wrappers used by ML-DSA (FIPS 204).
//!
//! This module no longer carries its own copy of the Keccak
//! permutation: it builds on top of the shared sponge core in
//! `crate::sha3`. The ML-DSA-specific surface (`sha3_256`,
//! `sha3_512`, `shake128`, `shake256`, `h_init`, `g_init`, plus the
//! `KeccakState` re-export consumed by the rest of the algorithm) is
//! unchanged.
pub use crateKeccakState;
use crate;
/// Compute SHA3-256 over the input and return the 32-byte digest.
/// Compute SHA3-512 over the input and return the 64-byte digest.
/// Create a new SHAKE128 extendable-output function (XOF) context.
///
/// SHAKE128 uses a rate of 168 bytes and domain separator 0x1f. Used
/// by ML-DSA for the G function (matrix expansion).
/// Create a new SHAKE256 extendable-output function (XOF) context.
///
/// SHAKE256 uses a rate of 136 bytes and domain separator 0x1f. Used
/// by ML-DSA for the H function (hashing, key derivation, signing).
/// Convenience function: absorb `input` into SHAKE256 and squeeze
/// into `out`.
/// Convenience function: absorb `input` into SHAKE128 and squeeze
/// into `out`.
/// Initialize the ML-DSA H function (SHAKE256 with streaming
/// interface). Alias for [`shake256`], named to match FIPS 204.
/// Initialize the ML-DSA G function (SHAKE128 with streaming
/// interface). Alias for [`shake128`], named to match FIPS 204.