starknet_os: add the privacy proof-fact leaf digest - #15090
einat-starkware wants to merge 1 commit into
Conversation
PR SummaryLow Risk Overview Adds a small Reviewed by Cursor Bugbot for commit 511537c. Bugbot is set up for automated code reviews on this repo. Configure here. |
a0d299e to
0aa8033
Compare
147b145 to
9ad4558
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware made 1 comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on einat-starkware).
crates/starknet_os/src/proof_fact_fold.rs line 25 at r1 (raw file):
} pub fn blake2s_over_u32_words(words: &[u32]) -> Blake2sDigestWords {
See if you can use the stwo's impl
9ad4558 to
12a9c13
Compare
|
Previously, Yoni-Starkware (Yoni) wrote…
Added a comment referencing the crate |
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware partially reviewed 3 files, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on einat-starkware).
The digest of one privacy transaction's proof facts, exactly as the proving side computes the corresponding leaf proof's public output: blake2s(encode_felt252s_to_u32s(proof_facts[2..])) - dropping the proof version and variant markers, matching the leaf simple bootloader's own output hashing. Pinned against the proving side's leaf digest golden. The recursive tree fold over these digests lands on top of this module. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmPJM3Wph4QLmFmhcxVsh4
12a9c13 to
511537c
Compare
First PR of the privacy proof-fact fold stack (OS-side design: reproduce the proving side's recursive proof-tree digest fold so the circuit verifier's output digest can be compared against an OS-computed value).
This PR adds only the leaf layer of the digest chain, in Rust:
starknet_os::proof_fact_foldwithcompute_leaf_output_digest— one transaction's leaf output digest,blake2s(encode_felt252s_to_u32s(proof_facts[2..]))(dropping the proof version and variant markers, keeping[program_hash, ...virtual OS output]), exactly the preimage the leaf simple bootloader hashes to its own output.Tested against a golden value taken from the proving side (
stwo_run_and_prove_recursive_treetests).Stack: this PR ← rust tree fold ← cairo leaf digest ← cairo tree fold ← OS output wiring (#15064) ← registry pin (#15086) ← verifier task (#15088).
🤖 Generated with Claude Code
https://claude.ai/code/session_01XmPJM3Wph4QLmFmhcxVsh4
Generated by Claude Code