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
//! `KeccakSponge` bus message.
//!
//! Per-invocation request tuple carrying:
//!
//! - `sponge_seq_id` — the sponge row at which the invocation's first block begins absorbing (= the
//! sponge's row counter at that row). The transcript chiplet uses it to derive the digest address
//! in the round chiplet's IP space.
//! - `chunk_ptr` — the chunk-tape base offset for this invocation (= the sponge's `chunk_ptr`
//! cursor value at that row). Shared identifier with the chunk chiplet's per-invocation segment
//! base; pins the sponge's `chunk_ptr` at the invocation start (the `chunk_ptr` chain is relaxed
//! at invocation seams — see the design notes).
//! - `len_bytes` — the length of the input in bytes; flows directly into the sponge's
//! `bytes_left_0` witness column on consume.
//!
//! Provided by the transcript chiplet (or whatever orchestrator
//! triggers Keccak), consumed by the sponge chiplet at the first row
//! of each invocation (`is_first_row_of_invocation = 1`).
//!
//! See the design notes for the role this message
//! plays in pinning the invocation's start, `chunk_ptr` base, and
//! `bytes_left_0`.
use Algebra;
use crate::;
/// LogUp message for the per-invocation Keccak sponge request: a 3-tuple
/// `(sponge_seq_id, chunk_ptr, len_bytes)`.
///
/// Provided on [`BusId::KeccakSponge`]. Encoded as
/// `bus_prefix[KeccakSponge] + β⁰·sponge_seq_id + β¹·chunk_ptr +
/// β²·len_bytes`. Each invocation produces exactly one such tuple,
/// consumed by the sponge on the row where `sponge_seq_id` matches the
/// row counter.