You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core,tlsn): let the verifier size the transcript it recorded
The prover's `ProveRequestMsg` carried a whole `PartialTranscript`, which states
how long each direction is. Converting it allocates that many bytes while the
message is still being parsed:
let mut sent = vec![0; compressed.sent_total];
Nothing bounds those totals. The validation just above only checks that the
revealed index fits inside the declared total, and an empty index fits inside
any total, so a message with no authenticated data may name any length. The
verifier does compare the declared length against the recorded session, but in
`accept()` -- one message after this allocation has already run. A `vec![0; n]`
that cannot be satisfied reaches `handle_alloc_error`, which aborts the process
rather than returning an error, so one prover ends every session on the verifier.
The length is redundant: the verifier recorded the session and already checks
the prover's number against its own. So the prover no longer sends it. A new
`TranscriptReveal` carries what the prover contributes -- the authenticated
bytes and their ranges -- and the verifier builds the transcript with
`into_partial`, passing the lengths it measured. There is no field in which to
state a length, so none can be acted on before it is checked, and the
length-mismatch branch in `verify` is removed because the mismatch is no longer
representable. The bounds check that remains, that the revealed ranges fit the
recorded length, runs in `into_partial` and returns an error.
`TranscriptReveal` is `CompressedPartialTranscript` without the two totals, so
its conversions delegate to the existing sibling impls rather than restating the
byte-copy loops.
This changes the prove message, so prover and verifier must upgrade together.
The version handshake already enforces that: a mismatched pair is refused on the
first message, before the prove message is sent.
Signed-off-by: xgreenx <xgreenx9999@gmail.com>
Assisted-by: Claude Opus 5
Signed-off-by: xgreenx <xgreenx9999@gmail.com>
0 commit comments