Skip to content

Commit d0db632

Browse files
authored
Merge pull request #14 from yugocabrio/clean1217
refactor: enforce 40 sumcheck evals
2 parents cd64e0c + fee26d0 commit d0db632

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

src/utils.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub fn fq_to_halves_be(f: &Fq) -> ([u8; 32], [u8; 32]) {
5151
(to_arr(low), to_arr(high))
5252
}
5353

54-
/// Load a Proof from a byte array (e.g. read from proof.bin).
54+
/// Load a Proof from a byte array.
5555
///
5656
/// Note (bb v0.87.0): G1 coordinates are encoded as two limbs per coordinate
5757
/// using the (lo136, hi<=118) split and stored in the order (x_lo, x_hi, y_lo, y_hi).
@@ -114,21 +114,9 @@ pub fn load_proof(proof_bytes: &[u8]) -> Proof {
114114
sumcheck_univariates.push(row);
115115
}
116116

117-
// 6) sumcheck_evaluations: auto-detect 40 or 41 entries from total file length
118-
let mut sumcheck_evaluations = Vec::new();
119-
let size_40 = 16 * 32 /*pairing*/
120-
+ 8 * 128 /*wires & lookups before univariates*/
121-
+ 28 * 8 * 32 /*univariates*/
122-
+ 40 * 32 /*evals*/
123-
+ 27 * 128 /*fold comms*/
124-
+ 28 * 32 /*A evals*/
125-
+ 2 * 128; /*Q + quotient*/
126-
let evals_to_read = if proof_bytes.len() >= size_40 + 32 {
127-
41
128-
} else {
129-
40
130-
};
131-
for _ in 0..evals_to_read {
117+
// 6) sumcheck_evaluations
118+
let mut sumcheck_evaluations = Vec::with_capacity(40);
119+
for _ in 0..40 {
132120
sumcheck_evaluations.push(read_fr(proof_bytes, &mut cursor));
133121
}
134122

0 commit comments

Comments
 (0)