diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1d55e8b..8897c573 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,11 +96,11 @@ jobs: with: use-cross: true command: build - args: --no-default-features --target aarch64-unknown-none + args: --workspace --no-default-features --target aarch64-unknown-none --exclude ark-pcs-bench-templates - name: Check uses: actions-rs/cargo@v1 with: use-cross: true command: check - args: --examples --no-default-features --target aarch64-unknown-none + args: --workspace --examples --no-default-features --target aarch64-unknown-none --exclude ark-pcs-bench-templates diff --git a/Cargo.toml b/Cargo.toml index 4b58457e..bc7f3243 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,38 +1,20 @@ -[package] -name = "ark-poly-commit" +[workspace] +members = ["poly-commit", "bench-templates"] +resolver = "2" + + +[workspace.package] version = "0.4.0" +authors = ["arkworks contributors"] description = "A library for constructing polynomial commitment schemes for use in zkSNARKs" repository = "https://github.com/arkworks-rs/poly-commit" documentation = "https://docs.rs/ark-poly-commit/" keywords = ["cryptography", "commitments", "elliptic-curves", "pairing"] -categories = ["cryptography"] include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] +categories = ["cryptography"] license = "MIT/Apache-2.0" edition = "2018" -[dependencies] -ark-serialize = { version = "^0.4.0", default-features = false, features = [ "derive" ] } -ark-ff = { version = "^0.4.0", default-features = false } -ark-ec = { version = "^0.4.0", default-features = false } -ark-poly = {version = "^0.4.0", default-features = false } -ark-crypto-primitives = {version = "^0.4.0", default-features = false, features = ["sponge"] } -ark-std = { version = "^0.4.0", default-features = false } - -ark-relations = { version = "^0.4.0", default-features = false, optional = true } -ark-r1cs-std = { version = "^0.4.0", default-features = false, optional = true } -hashbrown = { version = "0.13", default-features = false, optional = true } - -digest = "0.10" -derivative = { version = "2", features = [ "use_core" ] } -rayon = { version = "1", optional = true } - -[dev-dependencies] -ark-ed-on-bls12-381 = { version = "^0.4.0", default-features = false } -ark-bls12-381 = { version = "^0.4.0", default-features = false, features = [ "curve" ] } -ark-bls12-377 = { version = "^0.4.0", default-features = false, features = [ "curve" ] } -blake2 = { version = "0.10", default-features = false } -rand_chacha = { version = "0.3.0", default-features = false } - [profile.release] opt-level = 3 lto = "thin" @@ -45,13 +27,6 @@ debug-assertions = true incremental = true debug = true -[features] -default = [ "std", "parallel" ] -std = [ "ark-ff/std", "ark-ec/std", "ark-poly/std", "ark-std/std", "ark-relations/std", "ark-serialize/std", "ark-crypto-primitives/std"] -r1cs = [ "ark-relations", "ark-r1cs-std", "hashbrown", "ark-crypto-primitives/r1cs"] -print-trace = [ "ark-std/print-trace" ] -parallel = [ "std", "ark-ff/parallel", "ark-ec/parallel", "ark-poly/parallel", "ark-std/parallel", "rayon" ] - [patch.crates-io] ark-ff = { git = "https://github.com/arkworks-rs/algebra/" } ark-ec = { git = "https://github.com/arkworks-rs/algebra/" } @@ -60,4 +35,4 @@ ark-crypto-primitives = { git = "https://github.com/arkworks-rs/crypto-primitive ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" } ark-bls12-377 = { git = "https://github.com/arkworks-rs/curves/" } -ark-bls12-381 = { git = "https://github.com/arkworks-rs/curves/" } \ No newline at end of file +ark-bls12-381 = { git = "https://github.com/arkworks-rs/curves/" } diff --git a/README.md b/README.md index 7a4d582c..bdedd6bb 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,11 @@ This library comes with some unit and integration tests. Run these tests with: cargo test ``` +A benchmarking module is also provided for the `commit`, `open` and `verify` methods, as well as for computing the commitment and proof size. You can add a new benchmark for your scheme following the examples in the `pcs/benches` directory, or run the existing benchmarks with: +```bash +cargo bench +``` + Lastly, this library is instrumented with profiling infrastructure that prints detailed traces of execution time. To enable this, compile with `cargo build --features print-trace`. ## Usage diff --git a/bench-templates/Cargo.toml b/bench-templates/Cargo.toml new file mode 100644 index 00000000..854b4e2e --- /dev/null +++ b/bench-templates/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "ark-pcs-bench-templates" +version.workspace = true +authors.workspace = true +repository.workspace = true +categories.workspace = true +include.workspace = true +license.workspace = true +edition.workspace = true +publish = false + +[dependencies] +ark-poly-commit = { path = "../poly-commit", default-features = false } +ark-serialize = { version = "^0.4.0", default-features = false, features = [ "derive" ] } +ark-ff = { version = "^0.4.0", default-features = false } +ark-ec = { version = "^0.4.0", default-features = false } +ark-poly = {version = "^0.4.0", default-features = false } +ark-crypto-primitives = {version = "^0.4.0", default-features = false, features = ["sponge", "merkle_tree"] } +ark-std = { version = "^0.4.0", default-features = false } + +rand_chacha = { version = "0.3.0", default-features = false } +criterion = { version = "0.5", default-features = false } + +paste = "1.0" \ No newline at end of file diff --git a/bench-templates/src/lib.rs b/bench-templates/src/lib.rs new file mode 100644 index 00000000..1594ee7c --- /dev/null +++ b/bench-templates/src/lib.rs @@ -0,0 +1,278 @@ +use ark_crypto_primitives::sponge::{ + poseidon::{PoseidonConfig, PoseidonSponge}, + CryptographicSponge, +}; +use ark_ff::PrimeField; +use ark_poly::Polynomial; +use ark_serialize::{CanonicalSerialize, Compress}; +use ark_std::{test_rng, UniformRand}; +use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng}; + +use core::time::Duration; +use std::time::Instant; + +use ark_poly_commit::{challenge::ChallengeGenerator, LabeledPolynomial, PolynomialCommitment}; + +pub use criterion::*; +pub use paste::paste; + +/// Measure the time cost of {commit/open/verify} across a range of num_vars +pub fn bench_pcs_method< + F: PrimeField, + P: Polynomial, + PCS: PolynomialCommitment>, +>( + c: &mut Criterion, + range: Vec, + msg: &str, + method: impl Fn( + &PCS::CommitterKey, + &PCS::VerifierKey, + usize, + fn(usize, &mut ChaCha20Rng) -> P, + ) -> Duration, + rand_poly: fn(usize, &mut ChaCha20Rng) -> P, +) { + let mut group = c.benchmark_group(msg); + let rng = &mut ChaCha20Rng::from_rng(test_rng()).unwrap(); + + for num_vars in range { + let pp = PCS::setup(num_vars, Some(num_vars), rng).unwrap(); + let (ck, vk) = PCS::trim(&pp, num_vars, num_vars, None).unwrap(); + + group.bench_with_input( + BenchmarkId::from_parameter(num_vars), + &num_vars, + |b, num_vars| { + b.iter(|| method(&ck, &vk, *num_vars, rand_poly)); + }, + ); + } + + group.finish(); +} + +/// Report the time cost of a commitment +pub fn commit< + F: PrimeField, + P: Polynomial, + PCS: PolynomialCommitment>, +>( + ck: &PCS::CommitterKey, + _vk: &PCS::VerifierKey, + num_vars: usize, + rand_poly: fn(usize, &mut ChaCha20Rng) -> P, +) -> Duration { + let rng = &mut ChaCha20Rng::from_rng(test_rng()).unwrap(); + + let labeled_poly = + LabeledPolynomial::new("test".to_string(), rand_poly(num_vars, rng), None, None); + + let start = Instant::now(); + let (_, _) = PCS::commit(&ck, [&labeled_poly], Some(rng)).unwrap(); + start.elapsed() +} + +/// Report the size of a commitment +pub fn commitment_size< + F: PrimeField, + P: Polynomial, + PCS: PolynomialCommitment>, +>( + num_vars: usize, + rand_poly: fn(usize, &mut ChaCha20Rng) -> P, +) -> usize { + let rng = &mut ChaCha20Rng::from_rng(test_rng()).unwrap(); + + let pp = PCS::setup(num_vars, Some(num_vars), rng).unwrap(); + + let (ck, _) = PCS::trim(&pp, num_vars, num_vars, None).unwrap(); + + let labeled_poly = + LabeledPolynomial::new("test".to_string(), rand_poly(num_vars, rng), None, None); + + let (coms, _) = PCS::commit(&ck, [&labeled_poly], Some(rng)).unwrap(); + + coms[0].commitment().serialized_size(Compress::No) +} + +/// Report the time cost of an opening +pub fn open( + ck: &PCS::CommitterKey, + _vk: &PCS::VerifierKey, + num_vars: usize, + rand_poly: fn(usize, &mut ChaCha20Rng) -> P, +) -> Duration +where + F: PrimeField, + P: Polynomial, + PCS: PolynomialCommitment>, + P::Point: UniformRand, +{ + let rng = &mut ChaCha20Rng::from_rng(test_rng()).unwrap(); + + let labeled_poly = + LabeledPolynomial::new("test".to_string(), rand_poly(num_vars, rng), None, None); + + let (coms, randomness) = PCS::commit(&ck, [&labeled_poly], Some(rng)).unwrap(); + let point = P::Point::rand(rng); + + let start = Instant::now(); + let _ = PCS::open( + &ck, + [&labeled_poly], + &coms, + &point, + &mut ChallengeGenerator::new_univariate(&mut test_sponge()), + &randomness, + Some(rng), + ) + .unwrap(); + start.elapsed() +} + +/// Report the size of a proof +pub fn proof_size(num_vars: usize, rand_poly: fn(usize, &mut ChaCha20Rng) -> P) -> usize +where + F: PrimeField, + P: Polynomial, + PCS: PolynomialCommitment>, + + P::Point: UniformRand, +{ + let rng = &mut ChaCha20Rng::from_rng(test_rng()).unwrap(); + + let pp = PCS::setup(num_vars, Some(num_vars), rng).unwrap(); + + let (ck, _) = PCS::trim(&pp, num_vars, num_vars, None).unwrap(); + let labeled_poly = + LabeledPolynomial::new("test".to_string(), rand_poly(num_vars, rng), None, None); + + let (coms, randomness) = PCS::commit(&ck, [&labeled_poly], Some(rng)).unwrap(); + let point = P::Point::rand(rng); + + let proofs = PCS::open( + &ck, + [&labeled_poly], + &coms, + &point, + &mut ChallengeGenerator::new_univariate(&mut test_sponge()), + &randomness, + Some(rng), + ) + .unwrap(); + + let bproof: PCS::BatchProof = vec![proofs].into(); + + bproof.serialized_size(Compress::No) +} + +/// Report the time cost of a verification +pub fn verify( + ck: &PCS::CommitterKey, + vk: &PCS::VerifierKey, + num_vars: usize, + rand_poly: fn(usize, &mut ChaCha20Rng) -> P, +) -> Duration +where + F: PrimeField, + P: Polynomial, + PCS: PolynomialCommitment>, + P::Point: UniformRand, +{ + let rng = &mut ChaCha20Rng::from_rng(test_rng()).unwrap(); + + let labeled_poly = + LabeledPolynomial::new("test".to_string(), rand_poly(num_vars, rng), None, None); + + let (coms, randomness) = PCS::commit(&ck, [&labeled_poly], Some(rng)).unwrap(); + let point = P::Point::rand(rng); + let claimed_eval = labeled_poly.evaluate(&point); + let proof = PCS::open( + &ck, + [&labeled_poly], + &coms, + &point, + &mut ChallengeGenerator::new_univariate(&mut test_sponge()), + &randomness, + Some(rng), + ) + .unwrap(); + + let start = Instant::now(); + PCS::check( + &vk, + &coms, + &point, + [claimed_eval], + &proof, + &mut ChallengeGenerator::new_univariate(&mut test_sponge()), + None, + ) + .unwrap(); + start.elapsed() +} + +/*************** Auxiliary functions ***************/ + +fn test_sponge() -> PoseidonSponge { + let full_rounds = 8; + let partial_rounds = 31; + let alpha = 17; + + let mds = vec![ + vec![F::one(), F::zero(), F::one()], + vec![F::one(), F::one(), F::zero()], + vec![F::zero(), F::one(), F::one()], + ]; + + let mut v = Vec::new(); + let mut ark_rng = test_rng(); + + for _ in 0..(full_rounds + partial_rounds) { + let mut res = Vec::new(); + + for _ in 0..3 { + res.push(F::rand(&mut ark_rng)); + } + v.push(res); + } + let config = PoseidonConfig::new(full_rounds, partial_rounds, alpha, mds, v, 2, 1); + PoseidonSponge::new(&config) +} + +#[macro_export] +macro_rules! bench_method { + ($c:expr, $method:ident, $scheme_type:ty, $rand_poly:ident) => { + let scheme_type_str = stringify!($scheme_type); + let bench_name = format!("{} {}", stringify!($method), scheme_type_str); + bench_pcs_method::<_, _, $scheme_type>( + $c, + (MIN_NUM_VARS..MAX_NUM_VARS).step_by(2).collect(), + &bench_name, + $method::<_, _, $scheme_type>, + $rand_poly::<_>, + ); + }; +} + +#[macro_export] +macro_rules! bench { + ( + $scheme_type:ty, $rand_poly:ident + ) => { + fn bench_pcs(c: &mut Criterion) { + bench_method!(c, commit, $scheme_type, $rand_poly); + bench_method!(c, open, $scheme_type, $rand_poly); + bench_method!(c, verify, $scheme_type, $rand_poly); + } + + criterion_group!(benches, bench_pcs); + + paste! { + criterion_main!( + benches + ); + } + }; +} diff --git a/poly-commit/Cargo.toml b/poly-commit/Cargo.toml new file mode 100644 index 00000000..19098ce0 --- /dev/null +++ b/poly-commit/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "ark-poly-commit" +version.workspace = true +authors.workspace = true +repository.workspace = true +categories.workspace = true +include.workspace = true +license.workspace = true +edition.workspace = true + +[dependencies] +ark-serialize = { version = "^0.4.0", default-features = false, features = [ "derive" ] } +ark-ff = { version = "^0.4.0", default-features = false } +ark-ec = { version = "^0.4.0", default-features = false } +ark-poly = {version = "^0.4.0", default-features = false } +ark-crypto-primitives = {version = "^0.4.0", default-features = false, features = ["sponge", "merkle_tree"] } +ark-std = { version = "^0.4.0", default-features = false } + +ark-relations = { version = "^0.4.0", default-features = false, optional = true } +ark-r1cs-std = { version = "^0.4.0", default-features = false, optional = true } +hashbrown = { version = "0.13", default-features = false, optional = true } + +digest = "0.10" +derivative = { version = "2", features = [ "use_core" ] } +rayon = { version = "1", optional = true } + +[[bench]] +name = "pcs" +path = "benches/pcs.rs" +harness = false + +[[bench]] +name = "size" +path = "benches/size.rs" +harness = false + +[dev-dependencies] +ark-ed-on-bls12-381 = { version = "^0.4.0", default-features = false } +ark-bls12-381 = { version = "^0.4.0", default-features = false, features = [ "curve" ] } +ark-bls12-377 = { version = "^0.4.0", default-features = false, features = [ "curve" ] } +blake2 = { version = "0.10", default-features = false } +rand_chacha = { version = "0.3.0", default-features = false } +ark-pcs-bench-templates = { path = "../bench-templates" } + +[features] +default = [ "std", "parallel" ] +std = [ "ark-ff/std", "ark-ec/std", "ark-poly/std", "ark-std/std", "ark-relations/std", "ark-serialize/std", "ark-crypto-primitives/std"] +r1cs = [ "ark-relations", "ark-r1cs-std", "hashbrown", "ark-crypto-primitives/r1cs"] +print-trace = [ "ark-std/print-trace" ] +parallel = [ "std", "ark-ff/parallel", "ark-ec/parallel", "ark-poly/parallel", "ark-std/parallel", "rayon" ] diff --git a/src/README.md b/poly-commit/README.md similarity index 100% rename from src/README.md rename to poly-commit/README.md diff --git a/poly-commit/benches/pcs.rs b/poly-commit/benches/pcs.rs new file mode 100644 index 00000000..77ab04f7 --- /dev/null +++ b/poly-commit/benches/pcs.rs @@ -0,0 +1,28 @@ +use ark_ec::AffineRepr; +use ark_pcs_bench_templates::*; +use ark_poly::DenseUVPolynomial; +use blake2::Blake2s256; + +use ark_crypto_primitives::sponge::poseidon::PoseidonSponge; +use ark_ed_on_bls12_381::{EdwardsAffine, Fr}; +use ark_ff::PrimeField; +use ark_poly::univariate::DensePolynomial as DenseUnivariatePoly; +use ark_poly_commit::ipa_pc::InnerProductArgPC; + +use rand_chacha::ChaCha20Rng; + +type UniPoly = DenseUnivariatePoly; +type Sponge = PoseidonSponge<::ScalarField>; + +// IPA_PC over the JubJub curve with Blake2s as the hash function +#[allow(non_camel_case_types)] +type IPA_JubJub = InnerProductArgPC; + +fn rand_poly_ipa_pc(degree: usize, rng: &mut ChaCha20Rng) -> DenseUnivariatePoly { + DenseUnivariatePoly::rand(degree, rng) +} + +const MIN_NUM_VARS: usize = 10; +const MAX_NUM_VARS: usize = 20; + +bench!(IPA_JubJub, rand_poly_ipa_pc); diff --git a/poly-commit/benches/size.rs b/poly-commit/benches/size.rs new file mode 100644 index 00000000..ab09d8cd --- /dev/null +++ b/poly-commit/benches/size.rs @@ -0,0 +1,47 @@ +use ark_ec::AffineRepr; +use ark_pcs_bench_templates::*; +use ark_poly::DenseUVPolynomial; +use blake2::Blake2s256; + +use ark_crypto_primitives::sponge::poseidon::PoseidonSponge; +use ark_ed_on_bls12_381::{EdwardsAffine, Fr}; +use ark_ff::PrimeField; +use ark_poly::univariate::DensePolynomial as DenseUnivariatePoly; +use ark_poly_commit::ipa_pc::InnerProductArgPC; + +use rand_chacha::ChaCha20Rng; + +type UniPoly = DenseUnivariatePoly; +type Sponge = PoseidonSponge<::ScalarField>; +type PC = InnerProductArgPC; + +// IPA_PC over the JubJub curve with Blake2s as the hash function +#[allow(non_camel_case_types)] +type IPA_JubJub = PC; + +fn rand_poly_ipa_pc(degree: usize, rng: &mut ChaCha20Rng) -> DenseUnivariatePoly { + DenseUnivariatePoly::rand(degree, rng) +} + +const MIN_NUM_VARS: usize = 10; +const MAX_NUM_VARS: usize = 20; + +fn main() { + println!("\nIPA on JubJub: Commitment size"); + for num_vars in (MIN_NUM_VARS..MAX_NUM_VARS).step_by(2) { + println!( + "\tnum_vars: {}, size: {} B", + num_vars, + commitment_size::<_, _, IPA_JubJub>(num_vars, rand_poly_ipa_pc) + ); + } + + println!("\nIPA on JubJub: Proof size"); + for num_vars in (MIN_NUM_VARS..MAX_NUM_VARS).step_by(2) { + println!( + "\tnum_vars: {}, size: {} B", + num_vars, + proof_size::<_, _, IPA_JubJub>(num_vars, rand_poly_ipa_pc) + ); + } +} diff --git a/src/challenge.rs b/poly-commit/src/challenge.rs similarity index 100% rename from src/challenge.rs rename to poly-commit/src/challenge.rs diff --git a/src/constraints.rs b/poly-commit/src/constraints.rs similarity index 100% rename from src/constraints.rs rename to poly-commit/src/constraints.rs diff --git a/src/data_structures.rs b/poly-commit/src/data_structures.rs similarity index 100% rename from src/data_structures.rs rename to poly-commit/src/data_structures.rs diff --git a/src/error.rs b/poly-commit/src/error.rs similarity index 100% rename from src/error.rs rename to poly-commit/src/error.rs diff --git a/src/ipa_pc/data_structures.rs b/poly-commit/src/ipa_pc/data_structures.rs similarity index 100% rename from src/ipa_pc/data_structures.rs rename to poly-commit/src/ipa_pc/data_structures.rs diff --git a/src/ipa_pc/mod.rs b/poly-commit/src/ipa_pc/mod.rs similarity index 100% rename from src/ipa_pc/mod.rs rename to poly-commit/src/ipa_pc/mod.rs diff --git a/src/kzg10/data_structures.rs b/poly-commit/src/kzg10/data_structures.rs similarity index 100% rename from src/kzg10/data_structures.rs rename to poly-commit/src/kzg10/data_structures.rs diff --git a/src/kzg10/mod.rs b/poly-commit/src/kzg10/mod.rs similarity index 100% rename from src/kzg10/mod.rs rename to poly-commit/src/kzg10/mod.rs diff --git a/src/lib.rs b/poly-commit/src/lib.rs similarity index 100% rename from src/lib.rs rename to poly-commit/src/lib.rs diff --git a/src/marlin/marlin_pc/data_structures.rs b/poly-commit/src/marlin/marlin_pc/data_structures.rs similarity index 100% rename from src/marlin/marlin_pc/data_structures.rs rename to poly-commit/src/marlin/marlin_pc/data_structures.rs diff --git a/src/marlin/marlin_pc/mod.rs b/poly-commit/src/marlin/marlin_pc/mod.rs similarity index 100% rename from src/marlin/marlin_pc/mod.rs rename to poly-commit/src/marlin/marlin_pc/mod.rs diff --git a/src/marlin/marlin_pst13_pc/combinations.rs b/poly-commit/src/marlin/marlin_pst13_pc/combinations.rs similarity index 100% rename from src/marlin/marlin_pst13_pc/combinations.rs rename to poly-commit/src/marlin/marlin_pst13_pc/combinations.rs diff --git a/src/marlin/marlin_pst13_pc/data_structures.rs b/poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs similarity index 100% rename from src/marlin/marlin_pst13_pc/data_structures.rs rename to poly-commit/src/marlin/marlin_pst13_pc/data_structures.rs diff --git a/src/marlin/marlin_pst13_pc/mod.rs b/poly-commit/src/marlin/marlin_pst13_pc/mod.rs similarity index 100% rename from src/marlin/marlin_pst13_pc/mod.rs rename to poly-commit/src/marlin/marlin_pst13_pc/mod.rs diff --git a/src/marlin/mod.rs b/poly-commit/src/marlin/mod.rs similarity index 100% rename from src/marlin/mod.rs rename to poly-commit/src/marlin/mod.rs diff --git a/src/multilinear_pc/data_structures.rs b/poly-commit/src/multilinear_pc/data_structures.rs similarity index 100% rename from src/multilinear_pc/data_structures.rs rename to poly-commit/src/multilinear_pc/data_structures.rs diff --git a/src/multilinear_pc/mod.rs b/poly-commit/src/multilinear_pc/mod.rs similarity index 100% rename from src/multilinear_pc/mod.rs rename to poly-commit/src/multilinear_pc/mod.rs diff --git a/src/optional_rng.rs b/poly-commit/src/optional_rng.rs similarity index 100% rename from src/optional_rng.rs rename to poly-commit/src/optional_rng.rs diff --git a/src/sonic_pc/data_structures.rs b/poly-commit/src/sonic_pc/data_structures.rs similarity index 100% rename from src/sonic_pc/data_structures.rs rename to poly-commit/src/sonic_pc/data_structures.rs diff --git a/src/sonic_pc/mod.rs b/poly-commit/src/sonic_pc/mod.rs similarity index 100% rename from src/sonic_pc/mod.rs rename to poly-commit/src/sonic_pc/mod.rs diff --git a/src/streaming_kzg/data_structures.rs b/poly-commit/src/streaming_kzg/data_structures.rs similarity index 100% rename from src/streaming_kzg/data_structures.rs rename to poly-commit/src/streaming_kzg/data_structures.rs diff --git a/src/streaming_kzg/mod.rs b/poly-commit/src/streaming_kzg/mod.rs similarity index 100% rename from src/streaming_kzg/mod.rs rename to poly-commit/src/streaming_kzg/mod.rs diff --git a/src/streaming_kzg/space.rs b/poly-commit/src/streaming_kzg/space.rs similarity index 100% rename from src/streaming_kzg/space.rs rename to poly-commit/src/streaming_kzg/space.rs diff --git a/src/streaming_kzg/tests.rs b/poly-commit/src/streaming_kzg/tests.rs similarity index 100% rename from src/streaming_kzg/tests.rs rename to poly-commit/src/streaming_kzg/tests.rs diff --git a/src/streaming_kzg/time.rs b/poly-commit/src/streaming_kzg/time.rs similarity index 100% rename from src/streaming_kzg/time.rs rename to poly-commit/src/streaming_kzg/time.rs