Skip to content

Commit 1e121b7

Browse files
committed
Remove degree_bound and Commitment::bound
1 parent 728855f commit 1e121b7

File tree

8 files changed

+49
-144
lines changed

8 files changed

+49
-144
lines changed

Diff for: kimchi/src/prover.rs

+15-48
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ where
12301230

12311231
let mut polynomials = polys
12321232
.iter()
1233-
.map(|(p, d1_size)| (coefficients_form(p), None, non_hiding(*d1_size)))
1233+
.map(|(p, d1_size)| (coefficients_form(p), non_hiding(*d1_size)))
12341234
.collect::<Vec<_>>();
12351235

12361236
let fixed_hiding = |d1_size: usize| PolyComm {
@@ -1245,62 +1245,52 @@ where
12451245
//~~ * the poseidon selector
12461246
//~~ * the 15 registers/witness columns
12471247
//~~ * the 6 sigmas
1248-
polynomials.push((
1249-
coefficients_form(&public_poly),
1250-
None,
1251-
fixed_hiding(num_chunks),
1252-
));
1253-
polynomials.push((coefficients_form(&ft), None, blinding_ft));
1254-
polynomials.push((coefficients_form(&z_poly), None, z_comm.blinders));
1248+
polynomials.push((coefficients_form(&public_poly), fixed_hiding(num_chunks)));
1249+
polynomials.push((coefficients_form(&ft), blinding_ft));
1250+
polynomials.push((coefficients_form(&z_poly), z_comm.blinders));
12551251
polynomials.push((
12561252
evaluations_form(&index.column_evaluations.generic_selector4),
1257-
None,
12581253
fixed_hiding(num_chunks),
12591254
));
12601255
polynomials.push((
12611256
evaluations_form(&index.column_evaluations.poseidon_selector8),
1262-
None,
12631257
fixed_hiding(num_chunks),
12641258
));
12651259
polynomials.push((
12661260
evaluations_form(&index.column_evaluations.complete_add_selector4),
1267-
None,
12681261
fixed_hiding(num_chunks),
12691262
));
12701263
polynomials.push((
12711264
evaluations_form(&index.column_evaluations.mul_selector8),
1272-
None,
12731265
fixed_hiding(num_chunks),
12741266
));
12751267
polynomials.push((
12761268
evaluations_form(&index.column_evaluations.emul_selector8),
1277-
None,
12781269
fixed_hiding(num_chunks),
12791270
));
12801271
polynomials.push((
12811272
evaluations_form(&index.column_evaluations.endomul_scalar_selector8),
1282-
None,
12831273
fixed_hiding(num_chunks),
12841274
));
12851275
polynomials.extend(
12861276
witness_poly
12871277
.iter()
12881278
.zip(w_comm.iter())
1289-
.map(|(w, c)| (coefficients_form(w), None, c.blinders.clone()))
1279+
.map(|(w, c)| (coefficients_form(w), c.blinders.clone()))
12901280
.collect::<Vec<_>>(),
12911281
);
12921282
polynomials.extend(
12931283
index
12941284
.column_evaluations
12951285
.coefficients8
12961286
.iter()
1297-
.map(|coefficientm| (evaluations_form(coefficientm), None, non_hiding(num_chunks)))
1287+
.map(|coefficientm| (evaluations_form(coefficientm), non_hiding(num_chunks)))
12981288
.collect::<Vec<_>>(),
12991289
);
13001290
polynomials.extend(
13011291
index.column_evaluations.permutation_coefficients8[0..PERMUTS - 1]
13021292
.iter()
1303-
.map(|w| (evaluations_form(w), None, non_hiding(num_chunks)))
1293+
.map(|w| (evaluations_form(w), non_hiding(num_chunks)))
13041294
.collect::<Vec<_>>(),
13051295
);
13061296

@@ -1310,7 +1300,6 @@ where
13101300
{
13111301
polynomials.push((
13121302
evaluations_form(range_check0_selector8),
1313-
None,
13141303
non_hiding(num_chunks),
13151304
));
13161305
}
@@ -1319,7 +1308,6 @@ where
13191308
{
13201309
polynomials.push((
13211310
evaluations_form(range_check1_selector8),
1322-
None,
13231311
non_hiding(num_chunks),
13241312
));
13251313
}
@@ -1330,7 +1318,6 @@ where
13301318
{
13311319
polynomials.push((
13321320
evaluations_form(foreign_field_add_selector8),
1333-
None,
13341321
non_hiding(num_chunks),
13351322
));
13361323
}
@@ -1341,23 +1328,14 @@ where
13411328
{
13421329
polynomials.push((
13431330
evaluations_form(foreign_field_mul_selector8),
1344-
None,
13451331
non_hiding(num_chunks),
13461332
));
13471333
}
13481334
if let Some(xor_selector8) = index.column_evaluations.xor_selector8.as_ref() {
1349-
polynomials.push((
1350-
evaluations_form(xor_selector8),
1351-
None,
1352-
non_hiding(num_chunks),
1353-
));
1335+
polynomials.push((evaluations_form(xor_selector8), non_hiding(num_chunks)));
13541336
}
13551337
if let Some(rot_selector8) = index.column_evaluations.rot_selector8.as_ref() {
1356-
polynomials.push((
1357-
evaluations_form(rot_selector8),
1358-
None,
1359-
non_hiding(num_chunks),
1360-
));
1338+
polynomials.push((evaluations_form(rot_selector8), non_hiding(num_chunks)));
13611339
}
13621340

13631341
//~~ * optionally, the runtime table
@@ -1368,17 +1346,13 @@ where
13681346
let sorted_comms = lookup_context.sorted_comms.as_ref().unwrap();
13691347

13701348
for (poly, comm) in sorted_poly.iter().zip(sorted_comms) {
1371-
polynomials.push((coefficients_form(poly), None, comm.blinders.clone()));
1349+
polynomials.push((coefficients_form(poly), comm.blinders.clone()));
13721350
}
13731351

13741352
//~~ * add the lookup aggreg polynomial
13751353
let aggreg_poly = lookup_context.aggreg_coeffs.as_ref().unwrap();
13761354
let aggreg_comm = lookup_context.aggreg_comm.as_ref().unwrap();
1377-
polynomials.push((
1378-
coefficients_form(aggreg_poly),
1379-
None,
1380-
aggreg_comm.blinders.clone(),
1381-
));
1355+
polynomials.push((coefficients_form(aggreg_poly), aggreg_comm.blinders.clone()));
13821356

13831357
//~~ * add the combined table polynomial
13841358
let table_blinding = if lcs.runtime_selector.is_some() {
@@ -1399,7 +1373,7 @@ where
13991373

14001374
let joint_lookup_table = lookup_context.joint_lookup_table.as_ref().unwrap();
14011375

1402-
polynomials.push((coefficients_form(joint_lookup_table), None, table_blinding));
1376+
polynomials.push((coefficients_form(joint_lookup_table), table_blinding));
14031377

14041378
//~~ * if present, add the runtime table polynomial
14051379
if lcs.runtime_selector.is_some() {
@@ -1408,7 +1382,6 @@ where
14081382

14091383
polynomials.push((
14101384
coefficients_form(runtime_table),
1411-
None,
14121385
runtime_table_comm.blinders.clone(),
14131386
));
14141387
}
@@ -1418,27 +1391,21 @@ where
14181391
if let Some(runtime_lookup_table_selector) = lcs.runtime_selector.as_ref() {
14191392
polynomials.push((
14201393
evaluations_form(runtime_lookup_table_selector),
1421-
None,
14221394
non_hiding(1),
14231395
))
14241396
}
14251397
if let Some(xor_lookup_selector) = lcs.lookup_selectors.xor.as_ref() {
1426-
polynomials.push((evaluations_form(xor_lookup_selector), None, non_hiding(1)))
1398+
polynomials.push((evaluations_form(xor_lookup_selector), non_hiding(1)))
14271399
}
14281400
if let Some(lookup_gate_selector) = lcs.lookup_selectors.lookup.as_ref() {
1429-
polynomials.push((evaluations_form(lookup_gate_selector), None, non_hiding(1)))
1401+
polynomials.push((evaluations_form(lookup_gate_selector), non_hiding(1)))
14301402
}
14311403
if let Some(range_check_lookup_selector) = lcs.lookup_selectors.range_check.as_ref() {
1432-
polynomials.push((
1433-
evaluations_form(range_check_lookup_selector),
1434-
None,
1435-
non_hiding(1),
1436-
))
1404+
polynomials.push((evaluations_form(range_check_lookup_selector), non_hiding(1)))
14371405
}
14381406
if let Some(foreign_field_mul_lookup_selector) = lcs.lookup_selectors.ffmul.as_ref() {
14391407
polynomials.push((
14401408
evaluations_form(foreign_field_mul_lookup_selector),
1441-
None,
14421409
non_hiding(1),
14431410
))
14441411
}

Diff for: kimchi/src/verifier.rs

-7
Original file line numberDiff line numberDiff line change
@@ -911,21 +911,18 @@ where
911911
evaluations.extend(polys.into_iter().map(|(c, e)| Evaluation {
912912
commitment: c,
913913
evaluations: e,
914-
degree_bound: None,
915914
}));
916915

917916
//~~ * public input commitment
918917
evaluations.push(Evaluation {
919918
commitment: public_comm,
920919
evaluations: public_evals.to_vec(),
921-
degree_bound: None,
922920
});
923921

924922
//~~ * ft commitment (chunks of it)
925923
evaluations.push(Evaluation {
926924
commitment: ft_comm,
927925
evaluations: vec![vec![ft_eval0], vec![proof.ft_eval1]],
928-
degree_bound: None,
929926
});
930927

931928
for col in [
@@ -1009,7 +1006,6 @@ where
10091006
.ok_or(VerifyError::MissingCommitment(col))?
10101007
.clone(),
10111008
evaluations: vec![evals.zeta.clone(), evals.zeta_omega.clone()],
1012-
degree_bound: None,
10131009
});
10141010
}
10151011

@@ -1051,7 +1047,6 @@ where
10511047
evaluations.push(Evaluation {
10521048
commitment: table_comm,
10531049
evaluations: vec![lookup_table.zeta.clone(), lookup_table.zeta_omega.clone()],
1054-
degree_bound: None,
10551050
});
10561051

10571052
// add evaluation of the runtime table polynomial
@@ -1068,7 +1063,6 @@ where
10681063
evaluations.push(Evaluation {
10691064
commitment: runtime.clone(),
10701065
evaluations: vec![runtime_eval.zeta, runtime_eval.zeta_omega],
1071-
degree_bound: None,
10721066
});
10731067
}
10741068
}
@@ -1119,7 +1113,6 @@ where
11191113
.ok_or(VerifyError::MissingCommitment(col))?
11201114
.clone(),
11211115
evaluations: vec![evals.zeta.clone(), evals.zeta_omega.clone()],
1122-
degree_bound: None,
11231116
});
11241117
}
11251118

Diff for: poly-commitment/src/commitment.rs

+8-25
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,6 @@ where
440440

441441
/// Contains an evaluation table
442442
pub evaluations: Vec<Vec<G::ScalarField>>,
443-
444-
/// optional degree bound
445-
pub degree_bound: Option<usize>,
446443
}
447444

448445
/// Contains the batch evaluation
@@ -502,11 +499,7 @@ pub fn combine_evaluations<G: CommitmentCurve>(
502499
vec![G::ScalarField::zero(); num_evals]
503500
};
504501

505-
for Evaluation {
506-
evaluations,
507-
degree_bound,
508-
..
509-
} in evaluations
502+
for Evaluation { evaluations, .. } in evaluations
510503
.iter()
511504
.filter(|x| !x.commitment.elems.is_empty())
512505
{
@@ -517,10 +510,6 @@ pub fn combine_evaluations<G: CommitmentCurve>(
517510
}
518511
xi_i *= polyscale;
519512
}
520-
521-
if let Some(_m) = degree_bound {
522-
todo!("Misaligned chunked commitments are not supported")
523-
}
524513
}
525514

526515
acc
@@ -951,10 +940,9 @@ mod tests {
951940
let srs = SRS::<VestaG>::create(20);
952941
let rng = &mut StdRng::from_seed([0u8; 32]);
953942

954-
// commit the two polynomials (and upperbound the second one)
955-
let commitment = srs.commit(&poly1, 1, rng);
956-
let upperbound = poly2.degree() + 1;
957-
let bounded_commitment = srs.commit(&poly2, 1, rng);
943+
// commit the two polynomials
944+
let commitment1 = srs.commit(&poly1, 1, rng);
945+
let commitment2 = srs.commit(&poly2, 1, rng);
958946

959947
// create an aggregated opening proof
960948
let (u, v) = (Fp::rand(rng), Fp::rand(rng));
@@ -964,18 +952,15 @@ mod tests {
964952

965953
let polys: Vec<(
966954
DensePolynomialOrEvaluations<_, Radix2EvaluationDomain<_>>,
967-
Option<usize>,
968955
PolyComm<_>,
969956
)> = vec![
970957
(
971958
DensePolynomialOrEvaluations::DensePolynomial(&poly1),
972-
None,
973-
commitment.blinders,
959+
commitment1.blinders,
974960
),
975961
(
976962
DensePolynomialOrEvaluations::DensePolynomial(&poly2),
977-
Some(upperbound),
978-
bounded_commitment.blinders,
963+
commitment2.blinders,
979964
),
980965
];
981966
let elm = vec![Fp::rand(rng), Fp::rand(rng)];
@@ -1013,14 +998,12 @@ mod tests {
1013998

1014999
let evaluations = vec![
10151000
Evaluation {
1016-
commitment: commitment.commitment,
1001+
commitment: commitment1.commitment,
10171002
evaluations: poly1_chunked_evals,
1018-
degree_bound: None,
10191003
},
10201004
Evaluation {
1021-
commitment: bounded_commitment.commitment,
1005+
commitment: commitment2.commitment,
10221006
evaluations: poly2_chunked_evals,
1023-
degree_bound: Some(upperbound),
10241007
},
10251008
];
10261009

0 commit comments

Comments
 (0)