Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Brakedown multilinear PCS #131

Merged
merged 88 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f13a576
added hyrax PCS
Antonio95 Oct 25, 2023
fba3d80
Add univariate and multilinear Ligero PCS
mmagician Oct 25, 2023
9bbd74e
Add Brakedown
autquis Oct 25, 2023
e00d5b0
adapt the scheme to https://github.com/arkworks-rs/algebra/issues/691
mmagician Oct 26, 2023
9d5119b
move tests shared across univariate and ML ligero to utils
mmagician Oct 26, 2023
aba5dd2
adapt the scheme to https://github.com/arkworks-rs/algebra/issues/691
mmagician Oct 26, 2023
b1f65af
move tests shared across schemes to utils
mmagician Oct 26, 2023
86a322f
remove unused no-std import
mmagician Oct 26, 2023
69896d4
adapt the scheme to https://github.com/arkworks-rs/algebra/issues/691
mmagician Oct 26, 2023
ecf73f4
remove unused code in hyrax
mmagician Oct 26, 2023
234e049
Improve the choice of dimensions for polynomial matrix
Antonio95 Oct 20, 2023
dd281f1
Update comments
autquis Oct 26, 2023
14f80fd
parallelised row encoding and col-to-leaf hashing; significant perfor…
Antonio95 Oct 26, 2023
f0dd336
parallelised row encoding and col-to-leaf hashing; significant perfor…
Antonio95 Oct 26, 2023
f424c48
expanded on Future Optimisations section
Antonio95 Oct 26, 2023
6138fe2
fixed GH action failures: formatted and added feature flag
Antonio95 Oct 26, 2023
0628824
fixed GH action failures: formatted and added feature flag
Antonio95 Oct 26, 2023
0a2b119
Merge branch 'master' into ligero-uni-and-ml
mmagician Oct 28, 2023
0d8dc45
remove Prepared data types from `PolynomialCommitment` trait
mmagician Oct 28, 2023
c282010
Merge branch 'master' into brakedown
mmagician Oct 28, 2023
b0d825b
remove Prepared data types from `PolynomialCommitment` trait
mmagician Oct 28, 2023
dd58a1a
Merge branch 'master' into hyrax-pcs
mmagician Oct 28, 2023
06c59e9
Remove Prepared data types from `PolynomialCommitment` trait impl
mmagician Oct 28, 2023
a845018
merged master including new crate and directory structure
Antonio95 Oct 30, 2023
12afb33
added necessary dependencies overwritten by previous merge commit
Antonio95 Oct 30, 2023
9b48223
merged master including new crate and directory structure
Antonio95 Oct 30, 2023
5e955bc
fixed hashbrown version
Antonio95 Oct 30, 2023
3b0c371
Add back the cfg dependency for no-std build
mmagician Oct 30, 2023
6967c28
fixed hashbrown version
Antonio95 Oct 30, 2023
dd82dbc
pulled
Antonio95 Oct 30, 2023
a029081
created separate benchmark files
Antonio95 Oct 30, 2023
a7f465a
fixed duplicate dependency to match other branches
Antonio95 Oct 30, 2023
c010663
patched bn254 dep
Antonio95 Oct 30, 2023
d415053
restructured benchmark macros to accept ML schemes; benches working
Antonio95 Oct 31, 2023
acb65ec
moved hashing structures to bench-templates crate, started ligero ben…
Antonio95 Oct 31, 2023
80410d0
completed ligero benchmarks
Antonio95 Oct 31, 2023
25c34aa
added ligero benchmark file
Antonio95 Oct 31, 2023
f84e77e
merged master from arkworks
Antonio95 Oct 31, 2023
5bbc519
adapted to new crate structure and created benchmark for ML brakedown
Antonio95 Oct 31, 2023
3ef7309
Hyrax fix bench (#42)
mmagician Nov 13, 2023
61ff14a
Brakedown fix bench (#41)
mmagician Nov 13, 2023
370e77c
Ligero fix benches (#40)
mmagician Nov 13, 2023
cc1f75a
Hyrax parallel `commit` (#39)
mmagician Nov 13, 2023
7c7328d
Make Hyrax hiding again (#43)
Antonio95 Nov 13, 2023
d402d53
remove cfg(benches) attributes as that feature is no longer used
mmagician Nov 14, 2023
2bcff80
Fix tests: sponge config for univariate ligero
autquis Jan 9, 2024
4f6005d
Fix the comment
autquis Jan 15, 2024
2011982
Delete `IOPTranscript`, update with master (#44) (aka Brakedown++)
autquis Jan 17, 2024
a4ed4e1
Update a comment
autquis Jan 17, 2024
55d7b58
Delete `IOPTranscript`, update with master (#50) (aka Hyrax++)
autquis Jan 18, 2024
d13296c
Merge branch 'master' into hyrax-pcs
autquis Jan 18, 2024
bdf4236
Merge branch 'master' into brakedown
autquis Jan 18, 2024
694fa47
Delete `merlin` from dependencies
autquis Jan 18, 2024
044d74a
Delete `IOPTranscript`, update with master (#51) (aka Ligero++)
autquis Jan 18, 2024
d5c6039
Merge branch 'master' into ligero-uni-and-ml
autquis Jan 18, 2024
1f988ac
Add a few comments and update `Cargo.toml`
autquis Jan 18, 2024
5677c5b
Remove extra `cfg_iter!`
autquis Jan 22, 2024
c2e6412
Change `pedersen_commit` and add `cfg_into_iter!`
autquis Jan 22, 2024
ac4a14c
Hash and absorb
autquis Jan 23, 2024
d6a709e
BrakedownPCSParams need to be exported publicly
mmagician Jan 26, 2024
ddb1cc5
only enable num-traits on aarch (#58)
mmagician Jan 31, 2024
265e261
added Sync trait bound
Antonio95 Jun 3, 2024
a5cf4cf
removed TODO
Antonio95 Jun 3, 2024
8d356db
Fixed error whereby boolean value returned by path.verify was neglected
Antonio95 Jun 3, 2024
61d9a76
removed unnecessary qualification which linter didn't like
Antonio95 Jun 3, 2024
6c5e096
changed potential panic to returning Err, stopping early
Antonio95 Jun 4, 2024
18a3d84
removed unnecessary function defined inside check()
Antonio95 Jun 4, 2024
f3495d0
various minor fixes
Antonio95 Jun 6, 2024
f66901b
Add `ark-std` to patch
autquis Jun 9, 2024
103669f
Reorder Hyrax checks
Cesar199999 Jun 10, 2024
eee8e0b
Add `ark-std` to patch
autquis Jun 9, 2024
65ef67c
Downgrade `hashbrown`
autquis Oct 21, 2024
67ddd9c
Fix breaking change from algebra/poly (#72)
Cesar199999 Jun 28, 2024
175a610
Reorder deps
autquis Oct 21, 2024
d3e3808
Add dummy doc for nightly
autquis Oct 21, 2024
0858433
Fix `hashbrown` + Replace Blake2 by Blake3
autquis Oct 24, 2024
c2ba181
Revert to Blake2
autquis Oct 25, 2024
9e310f5
Merge branch 'master' into hyrax-pcs
autquis Oct 25, 2024
9b03b60
Fix merging issues
autquis Oct 25, 2024
f5924ee
Test if CI is happy
autquis Oct 25, 2024
cb20740
Revert and cleanup
autquis Oct 25, 2024
5239162
Delete dummy doc
autquis Oct 25, 2024
552163a
Merge branch 'hyrax-pcs' into ligero-uni-and-ml
autquis Oct 25, 2024
921d8ca
Bring back `num_traits`
autquis Oct 25, 2024
adac1b3
Merge branch 'ligero-uni-and-ml' into brakedown
autquis Oct 25, 2024
9a2fdc1
Fix merge conflict for README.md
autquis Oct 25, 2024
2f853cf
Add `/` to Cargo.toml
autquis Oct 25, 2024
6781490
Merge branch 'master' into brakedown
autquis Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Unless you explicitly state otherwise, any contribution that you submit to this
[aurora-light]: https://ia.cr/2019/601
[pcd-acc]: https://ia.cr/2020/499
[pst]: https://ia.cr/2011/587
[brakedown]: https://ia.cr/2021/1043
[ligero]: https://ia.cr/2022/1608
[hyrax]: https://eprint.iacr.org/2017/1132

Expand Down Expand Up @@ -220,6 +221,10 @@ CCS 2017
Riad S. Wahby, Ioanna Tzialla, abhi shelat, Justin Thaler, Michael Walfish
2018 IEEE Symposium on Security and Privacy

[Brakedown: Linear-time and field-agnostic SNARKs for R1CS][brakedown]
Alexander Golovnev, Jonathan Lee, Srinath Setty, Justin Thaler, Riad S. Wahby
CRYPTO 2023

## Acknowledgements

This work was supported by: an Engineering and Physical Sciences Research Council grant; a Google Faculty Award; the RISELab at UC Berkeley; and donations from the Ethereum Foundation and the Interchain Foundation.
6 changes: 5 additions & 1 deletion poly-commit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ name = "ipa_times"
path = "benches/ipa_times.rs"
harness = false

[[bench]]
name = "brakedown_times"
path = "benches/brakedown_ml_times.rs"
harness = false

[[bench]]
name = "ligero_ml_times"
path = "benches/ligero_ml_times.rs"
harness = false


[[bench]]
name = "hyrax_times"
path = "benches/hyrax_times.rs"
Expand Down
59 changes: 59 additions & 0 deletions poly-commit/benches/brakedown_ml_times.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
use ark_crypto_primitives::{
crh::{sha256::Sha256, CRHScheme, TwoToOneCRHScheme},
merkle_tree::{ByteDigestConverter, Config},
};
use ark_pcs_bench_templates::*;
use ark_poly::{DenseMultilinearExtension, MultilinearExtension};

use ark_bn254::Fr;
use ark_ff::PrimeField;

use ark_poly_commit::linear_codes::{LinearCodePCS, MultilinearBrakedown};
use blake2::Blake2s256;
use rand_chacha::ChaCha20Rng;

// Brakedown PCS over BN254
struct MerkleTreeParams;
type LeafH = LeafIdentityHasher;
type CompressH = Sha256;
impl Config for MerkleTreeParams {
type Leaf = Vec<u8>;

type LeafDigest = <LeafH as CRHScheme>::Output;
type LeafInnerDigestConverter = ByteDigestConverter<Self::LeafDigest>;
type InnerDigest = <CompressH as TwoToOneCRHScheme>::Output;

type LeafHash = LeafH;
type TwoToOneHash = CompressH;
}

pub type MLE<F> = DenseMultilinearExtension<F>;
type MTConfig = MerkleTreeParams;
type ColHasher<F> = FieldToBytesColHasher<F, Blake2s256>;
type Brakedown<F> = LinearCodePCS<
MultilinearBrakedown<F, MTConfig, MLE<F>, ColHasher<F>>,
F,
MLE<F>,
MTConfig,
ColHasher<F>,
>;

fn rand_poly_brakedown_ml<F: PrimeField>(
num_vars: usize,
rng: &mut ChaCha20Rng,
) -> DenseMultilinearExtension<F> {
DenseMultilinearExtension::rand(num_vars, rng)
}

fn rand_point_brakedown_ml<F: PrimeField>(num_vars: usize, rng: &mut ChaCha20Rng) -> Vec<F> {
(0..num_vars).map(|_| F::rand(rng)).collect()
}

const MIN_NUM_VARS: usize = 12;
const MAX_NUM_VARS: usize = 22;

bench!(
Brakedown<Fr>,
rand_poly_brakedown_ml,
rand_point_brakedown_ml
);
4 changes: 4 additions & 0 deletions poly-commit/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ pub enum Error {
/// Error resulting from hashing in linear code - based PCS.
HashingError,

/// Shows that encoding is not feasible
EncodingError,

/// This means a commitment with a certain label was matched with a
/// a polynomial which has a different label - which shouldn't happen
MismatchedLabels {
Expand Down Expand Up @@ -235,6 +238,7 @@ impl core::fmt::Display for Error {
Error::TranscriptError => write!(f, "Incorrect transcript manipulation"),
Error::InvalidParameters(err) => write!(f, "{}", err),
Error::HashingError => write!(f, "Error resulting from hashing"),
Error::EncodingError => write!(f, "Encoding failed"),
Error::MismatchedLabels { commitment_label, polynomial_label } =>
write!(f, "Mismatched labels: commitment label: {}, polynomial label: {}",
commitment_label,
Expand Down
1 change: 1 addition & 0 deletions poly-commit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ pub mod streaming_kzg;
/// Scheme based on the Ligero construction in [[Ligero]][ligero].
///
/// [ligero]: https://eprint.iacr.org/2022/1608
/// [brakedown]: https://eprint.iacr.org/2021/1043.pdf
pub mod linear_codes;

/// A polynomial commitment scheme based on the hardness of the
Expand Down
Loading
Loading