Skip to content

Commit 5752c76

Browse files
ryanlehweikengchenoblivious-app
authored
Multivariate marlin (#50)
* Add multivariate pc support * Integrate new polynomial interfaces * Fix no_std * Reduce code reuse * Small optimizations * Update for arkworks + tweaks * Fix * fmt * Handle the conflict with `master` on sonic_pc * Handle the upstream conflict * Handle the conflict with the upstream * Handle the conflict with the upstream * Cargo fmt * mul update; add serialization * Update the references * Reconcile the citation * fix some missing points Co-authored-by: Weikeng Chen <w.k@berkeley.edu> Co-authored-by: oblivious-app <55861861+oblivious-app@users.noreply.github.com>
1 parent 575c765 commit 5752c76

File tree

9 files changed

+2071
-350
lines changed

9 files changed

+2071
-350
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<a href="https://github.com/arkworks-rs/poly-commit/blob/master/LICENSE-MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
66
</p>
77

8-
`poly-commit` is a Rust library that implements (univariate) *polynomial commitment schemes*. This library was initially developed as part of the [Marlin paper][marlin], and is released under the MIT License and the Apache v2 License (see [License](#license)).
8+
`poly-commit` is a Rust library that implements *polynomial commitment schemes*. This library was initially developed as part of the [Marlin paper][marlin], and is released under the MIT License and the Apache v2 License (see [License](#license)).
99

1010
**WARNING:** This is an academic prototype, and in particular has not received careful code review. This implementation is NOT ready for production use.
1111

@@ -54,6 +54,7 @@ Unless you explicitly state otherwise, any contribution that you submit to this
5454
[sonic]: https://ia.cr/2019/099
5555
[aurora-light]: https://ia.cr/2019/601
5656
[pcd-acc]: https://ia.cr/2020/499
57+
[pst]: https://ia.cr.org/2011/587
5758

5859
## Reference papers
5960

@@ -65,7 +66,7 @@ ASIACRYPT 2010
6566
Mary Maller, Sean Bowe, Markulf Kohlweiss, Sarah Meiklejohn
6667
CCS 2019
6768

68-
[AuroraLight: Improved prover efficiency and SRS size in a Sonic-like system][aurora-light]
69+
[AuroraLight: Improved Prover Efficiency and SRS Size in a Sonic-Like System][aurora-light]
6970
Ariel Gabizon
7071
ePrint, 2019
7172

@@ -75,8 +76,11 @@ EUROCRYPT 2020
7576

7677
[Proof-Carrying Data from Accumulation Schemes][pcd-acc]
7778
Benedikt Bünz, Alessandro Chiesa, [Pratyush Mishra](https://www.github.com/pratyush), Nicholas Spooner
78-
ePrint, 2020
79+
TCC 2020
7980

81+
[Signatures of Correct Computation][pst]
82+
Charalampos Papamanthou, Elaine Shi, Roberto Tamassia
83+
TCC 2013
8084

8185
## Acknowledgements
8286

src/error.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ pub enum Error {
7979

8080
/// The inputs to `commit`, `open` or `verify` had incorrect lengths.
8181
IncorrectInputLength(String),
82+
83+
/// An invalid number of variables was provided to `setup`
84+
InvalidNumberOfVariables,
85+
86+
/// The degree of the `index`-th polynomial passed to `commit`, `open`
87+
/// or `check` was incorrect, that is, `supported_degree <= poly_degree`
88+
PolynomialDegreeTooLarge {
89+
/// Degree of the polynomial.
90+
poly_degree: usize,
91+
/// Maximum supported degree.
92+
supported_degree: usize,
93+
/// Index of the offending polynomial.
94+
label: String,
95+
},
8296
}
8397

8498
impl core::fmt::Display for Error {
@@ -151,6 +165,19 @@ impl core::fmt::Display for Error {
151165
supported degree ({:?})",
152166
degree_bound, label, poly_degree, supported_degree
153167
),
168+
Error::InvalidNumberOfVariables => write!(
169+
f,
170+
"An invalid number of variables was provided to `setup`"
171+
),
172+
Error::PolynomialDegreeTooLarge {
173+
poly_degree,
174+
supported_degree,
175+
label,
176+
} => write!(
177+
f,
178+
"the polynomial {} has degree {:?}, but parameters only
179+
support up to degree ({:?})", label, poly_degree, supported_degree
180+
),
154181
Error::IncorrectInputLength(err) => write!(f, "{}", err),
155182
}
156183
}

src/lib.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ pub mod error;
4444
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
4545
pub use error::*;
4646

47+
/// Univariate and multivariate polynomial commitment schemes
48+
/// which (optionally) enable hiding commitments by following
49+
/// the approach outlined in [[CHMMVW20, "Marlin"]][marlin].
50+
///
51+
/// [marlin]: https://eprint.iacr.org/2019/1047
52+
pub mod marlin;
53+
4754
/// A random number generator that bypasses some limitations of the Rust borrow
4855
/// checker.
4956
pub mod optional_rng;
@@ -69,7 +76,7 @@ pub mod kzg10;
6976
///
7077
/// [kzg]: http://cacr.uwaterloo.ca/techreports/2010/cacr2010-10.pdf
7178
/// [marlin]: https://eprint.iacr.org/2019/1047
72-
pub mod marlin_pc;
79+
pub use marlin::marlin_pc;
7380

7481
/// Polynomial commitment scheme based on the construction in [[KZG10]][kzg],
7582
/// modified to obtain batching and to enforce strict
@@ -90,6 +97,14 @@ pub mod sonic_pc;
9097
/// [pcdas]: https://eprint.iacr.org/2020/499
9198
pub mod ipa_pc;
9299

100+
/// Multivariate polynomial commitment based on the construction in
101+
/// [[PST13]][pst] with batching and (optional) hiding property inspired
102+
/// by the univariate scheme in [[CHMMVW20, "Marlin"]][marlin]
103+
///
104+
/// [pst]: https://eprint.iacr.org/2011/587.pdf
105+
/// [marlin]: https://eprint.iacr.org/2019/104
106+
pub use marlin::marlin_pst13_pc;
107+
93108
/// `QuerySet` is the set of queries that are to be made to a set of labeled polynomials/equations
94109
/// `p` that have previously been committed to. Each element of a `QuerySet` is a pair of
95110
/// `(label, (point_label, point))`, where `label` is the label of a polynomial in `p`,

0 commit comments

Comments
 (0)