|
|
@ -90,10 +90,7 @@ impl DerefsEvalProof { |
|
|
|
transcript: &mut Transcript,
|
|
|
|
random_tape: &mut RandomTape,
|
|
|
|
) -> PolyEvalProof {
|
|
|
|
assert_eq!(
|
|
|
|
joint_poly.get_num_vars(),
|
|
|
|
r.len() + evals.len().log_2() as usize
|
|
|
|
);
|
|
|
|
assert_eq!(joint_poly.get_num_vars(), r.len() + evals.len().log_2());
|
|
|
|
|
|
|
|
// append the claimed evaluations to transcript
|
|
|
|
evals.append_to_transcript(b"evals_ops_val", transcript);
|
|
|
@ -101,7 +98,7 @@ impl DerefsEvalProof { |
|
|
|
// n-to-1 reduction
|
|
|
|
let (r_joint, eval_joint) = {
|
|
|
|
let challenges =
|
|
|
|
transcript.challenge_vector(b"challenge_combine_n_to_one", evals.len().log_2() as usize);
|
|
|
|
transcript.challenge_vector(b"challenge_combine_n_to_one", evals.len().log_2());
|
|
|
|
let mut poly_evals = DensePolynomial::new(evals);
|
|
|
|
for i in (0..challenges.len()).rev() {
|
|
|
|
poly_evals.bound_poly_var_bot(&challenges[i]);
|
|
|
@ -167,7 +164,7 @@ impl DerefsEvalProof { |
|
|
|
|
|
|
|
// n-to-1 reduction
|
|
|
|
let challenges =
|
|
|
|
transcript.challenge_vector(b"challenge_combine_n_to_one", evals.len().log_2() as usize);
|
|
|
|
transcript.challenge_vector(b"challenge_combine_n_to_one", evals.len().log_2());
|
|
|
|
let mut poly_evals = DensePolynomial::new(evals);
|
|
|
|
for i in (0..challenges.len()).rev() {
|
|
|
|
poly_evals.bound_poly_var_bot(&challenges[i]);
|
|
|
@ -301,15 +298,15 @@ impl SparseMatPolyCommitmentGens { |
|
|
|
num_nz_entries: usize,
|
|
|
|
batch_size: usize,
|
|
|
|
) -> SparseMatPolyCommitmentGens {
|
|
|
|
let num_vars_ops = num_nz_entries.next_power_of_two().log_2() as usize
|
|
|
|
+ (batch_size * 5).next_power_of_two().log_2() as usize;
|
|
|
|
let num_vars_ops =
|
|
|
|
num_nz_entries.next_power_of_two().log_2() + (batch_size * 5).next_power_of_two().log_2();
|
|
|
|
let num_vars_mem = if num_vars_x > num_vars_y {
|
|
|
|
num_vars_x
|
|
|
|
} else {
|
|
|
|
num_vars_y
|
|
|
|
} + 1;
|
|
|
|
let num_vars_derefs = num_nz_entries.next_power_of_two().log_2() as usize
|
|
|
|
+ (batch_size * 2).next_power_of_two().log_2() as usize;
|
|
|
|
let num_vars_derefs =
|
|
|
|
num_nz_entries.next_power_of_two().log_2() + (batch_size * 2).next_power_of_two().log_2();
|
|
|
|
|
|
|
|
let gens_ops = PolyCommitmentGens::new(num_vars_ops, label);
|
|
|
|
let gens_mem = PolyCommitmentGens::new(num_vars_mem, label);
|
|
|
@ -779,10 +776,8 @@ impl HashLayerProof { |
|
|
|
evals_ops.extend(&eval_val_vec);
|
|
|
|
evals_ops.resize(evals_ops.len().next_power_of_two(), Scalar::zero());
|
|
|
|
evals_ops.append_to_transcript(b"claim_evals_ops", transcript);
|
|
|
|
let challenges_ops = transcript.challenge_vector(
|
|
|
|
b"challenge_combine_n_to_one",
|
|
|
|
evals_ops.len().log_2() as usize,
|
|
|
|
);
|
|
|
|
let challenges_ops =
|
|
|
|
transcript.challenge_vector(b"challenge_combine_n_to_one", evals_ops.len().log_2());
|
|
|
|
|
|
|
|
let mut poly_evals_ops = DensePolynomial::new(evals_ops);
|
|
|
|
for i in (0..challenges_ops.len()).rev() {
|
|
|
@ -808,10 +803,8 @@ impl HashLayerProof { |
|
|
|
// form a single decommitment using comb_comb_mem at rand_mem
|
|
|
|
let evals_mem: Vec<Scalar> = vec![eval_row_audit_ts, eval_col_audit_ts];
|
|
|
|
evals_mem.append_to_transcript(b"claim_evals_mem", transcript);
|
|
|
|
let challenges_mem = transcript.challenge_vector(
|
|
|
|
b"challenge_combine_two_to_one",
|
|
|
|
evals_mem.len().log_2() as usize,
|
|
|
|
);
|
|
|
|
let challenges_mem =
|
|
|
|
transcript.challenge_vector(b"challenge_combine_two_to_one", evals_mem.len().log_2());
|
|
|
|
|
|
|
|
let mut poly_evals_mem = DensePolynomial::new(evals_mem);
|
|
|
|
for i in (0..challenges_mem.len()).rev() {
|
|
|
@ -953,10 +946,8 @@ impl HashLayerProof { |
|
|
|
evals_ops.extend(eval_val_vec);
|
|
|
|
evals_ops.resize(evals_ops.len().next_power_of_two(), Scalar::zero());
|
|
|
|
evals_ops.append_to_transcript(b"claim_evals_ops", transcript);
|
|
|
|
let challenges_ops = transcript.challenge_vector(
|
|
|
|
b"challenge_combine_n_to_one",
|
|
|
|
evals_ops.len().log_2() as usize,
|
|
|
|
);
|
|
|
|
let challenges_ops =
|
|
|
|
transcript.challenge_vector(b"challenge_combine_n_to_one", evals_ops.len().log_2());
|
|
|
|
|
|
|
|
let mut poly_evals_ops = DensePolynomial::new(evals_ops);
|
|
|
|
for i in (0..challenges_ops.len()).rev() {
|
|
|
@ -979,10 +970,8 @@ impl HashLayerProof { |
|
|
|
// form a single decommitment using comb_comb_mem at rand_mem
|
|
|
|
let evals_mem: Vec<Scalar> = vec![*eval_row_audit_ts, *eval_col_audit_ts];
|
|
|
|
evals_mem.append_to_transcript(b"claim_evals_mem", transcript);
|
|
|
|
let challenges_mem = transcript.challenge_vector(
|
|
|
|
b"challenge_combine_two_to_one",
|
|
|
|
evals_mem.len().log_2() as usize,
|
|
|
|
);
|
|
|
|
let challenges_mem =
|
|
|
|
transcript.challenge_vector(b"challenge_combine_two_to_one", evals_mem.len().log_2());
|
|
|
|
|
|
|
|
let mut poly_evals_mem = DensePolynomial::new(evals_mem);
|
|
|
|
for i in (0..challenges_mem.len()).rev() {
|
|
|
@ -1632,8 +1621,8 @@ use rand::RngCore; |
|
|
|
let num_nz_entries: usize = 256;
|
|
|
|
let num_rows: usize = 256;
|
|
|
|
let num_cols: usize = 256;
|
|
|
|
let num_vars_x: usize = num_rows.log_2() as usize;
|
|
|
|
let num_vars_y: usize = num_cols.log_2() as usize;
|
|
|
|
let num_vars_x: usize = num_rows.log_2();
|
|
|
|
let num_vars_y: usize = num_cols.log_2();
|
|
|
|
|
|
|
|
let mut M: Vec<SparseMatEntry> = Vec::new();
|
|
|
|
|
|
|
|