Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuangWu121 committed Jan 27, 2025
1 parent dd392e3 commit 3004711
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/src/stwo/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ fn get_dummy_challenges<MC: MerkleChannel>(
})
})
.collect::<BTreeSet<_>>();

// Stwo provides a function to draw challenges from the secure field `QM31`,
// which consists of 4 `M31` elements. We calculate the total number of challenges
// needed in the `M31` field, round it up to the next multiple of 4,
// and then compute the number of draws required from the `QM31` field.
let number_of_qm31_challenges = ((challenges_stage0.len() + 4) & !3) >> 2;

let challenge_channel = &mut <MC as MerkleChannel>::C::default();
Expand All @@ -585,7 +588,7 @@ fn get_dummy_challenges<MC: MerkleChannel>(
.flat_map(|_| {
let qm31_challenge = challenge_channel.draw_felt();
[
qm31_challenge.0.0,
qm31_challenge.0 .0,
qm31_challenge.0 .1,
qm31_challenge.1 .0,
qm31_challenge.1 .1,
Expand Down

0 comments on commit 3004711

Please sign in to comment.