Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Fix/refactors (#104)
Browse files Browse the repository at this point in the history
* Rename UVPolynomial to DenseUVPolynomial

needed due to arkworks-rs/algebra#412

* Fix formatting

* Fix `msm` usage after `ark-ec` breaking change

Use `<E::G{1,2}Projective as VariableBaseMSM>::msm_bigint` instead of `VariableBase::msm`

* Removed ToBytes implementations and replaced uses of the tobytes! macro.

* Update Cargo.toml

* Update src/ipa_pc/mod.rs

* Apply suggestions from code review

* apply fmt

* small change to ipa_pc open

Co-authored-by: Marcin Górny <[email protected]>
Co-authored-by: Weikeng Chen <[email protected]>
  • Loading branch information
3 people authored and Mara Mihali committed Dec 8, 2022
1 parent a6def66 commit 0b0eec2
Show file tree
Hide file tree
Showing 24 changed files with 1,217 additions and 2,691 deletions.
156 changes: 100 additions & 56 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,76 +1,120 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)

[package]
edition = "2018"
name = "ark-poly-commit"
version = "0.3.0"
authors = [
"Alessandro Chiesa <[email protected]>",
"Mary Maller <[email protected]>",
"Yuncong Hu <[email protected]>",
"William Lin",
"Pratyush Mishra <[email protected]>",
"Noah Vesely <[email protected]>",
"Nicholas Ward <[email protected]>",
"arkworks contributors"
]
authors = ["Alessandro Chiesa <[email protected]>", "Mary Maller <[email protected]>", "Yuncong Hu <[email protected]>", "William Lin", "Pratyush Mishra <[email protected]>", "Noah Vesely <[email protected]>", "Nicholas Ward <[email protected]>", "arkworks contributors"]
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
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"]
license = "MIT/Apache-2.0"
edition = "2018"

[dependencies]
ark-serialize = { version = "^0.3.0", default-features = false, features = [ "derive" ] }
ark-ff = { version = "^0.3.0", default-features = false }
ark-ec = { version = "^0.3.0", default-features = false }
ark-poly = {version = "^0.3.0", default-features = false }
ark-sponge = {version = "^0.3.0", default-features = false}

ark-std = { version = "^0.3.0", default-features = false }
ark-relations = { version = "^0.3.0", default-features = false, optional = true }
ark-r1cs-std = { version = "^0.3.0", default-features = false, optional = true }
hashbrown = { version = "0.9", optional = true }

digest = "0.9"
rayon = { version = "1", optional = true }
derivative = { version = "2", features = [ "use_core" ] }

[dev-dependencies]
ark-ed-on-bls12-381 = { version = "^0.3.0", default-features = false }
ark-bls12-381 = { version = "^0.3.0", default-features = false, features = [ "curve" ] }
ark-bls12-377 = { version = "^0.3.0", default-features = false, features = [ "curve" ] }
blake2 = { version = "0.9", default-features = false }
rand_chacha = { version = "0.3.0", default-features = false }

repository = "https://github.com/arkworks-rs/poly-commit"
[profile.release]
opt-level = 3
lto = "thin"
incremental = true
debug = true
incremental = true

[dependencies]
colored = "2.0.0"
threadpool = "1.0"

[profile.test]
opt-level = 3
debug = true
debug-assertions = true
incremental = true
debug = true
[dependencies.ark-ec]
version = "^0.3.0"
default-features = false

[dependencies.ark-ff]
version = "^0.3.0"
default-features = false

[dependencies.ark-nonnative-field]
version = "^0.3.0"
optional = true
default-features = false

[dependencies.ark-poly]
version = "^0.3.0"
default-features = false

[dependencies.ark-r1cs-std]
version = "^0.3.0"
optional = true
default-features = false

[dependencies.ark-relations]
version = "^0.3.0"
optional = true
default-features = false

[dependencies.ark-serialize]
version = "^0.3.0"
features = ["derive"]
default-features = false

[dependencies.ark-std]
version = "^0.3.0"
default-features = false

[dependencies.derivative]
version = "2"
features = ["use_core"]

[dependencies.digest]
version = "0.9"

[dependencies.hashbrown]
version = "0.9"
optional = true

[dependencies.rayon]
version = "1"
optional = true

[dependencies.tracing]
version = "0.1"
features = ["attributes"]
default-features = false
[dev-dependencies.ark-bls12-377]
version = "^0.3.0"
features = ["curve"]
default-features = false

[dev-dependencies.ark-bls12-381]
version = "^0.3.0"
features = ["curve"]
default-features = false

[dev-dependencies.ark-ed-on-bls12-381]
version = "^0.3.0"
default-features = false

# To be removed in the new release.
[patch.crates-io]
ark-std = { git = "https://github.com/arkworks-rs/std" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra" }
ark-ff = { git = "https://github.com/arkworks-rs/algebra" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra" }
ark-bls12-381 = { git = "https://github.com/arkworks-rs/curves" }
ark-bls12-377 = { git = "https://github.com/arkworks-rs/curves" }
ark-ed-on-bls12-381 = { git = "https://github.com/arkworks-rs/curves" }
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std" }
ark-sponge = { git = "https://github.com/arkworks-rs/sponge" }
[dev-dependencies.blake2]
version = "0.9"
default-features = false

[features]
default = [ "std", "parallel" ]
std = [ "ark-ff/std", "ark-ec/std", "ark-poly/std", "ark-std/std", "ark-relations/std", "ark-serialize/std", "ark-sponge/std"]
r1cs = [ "ark-relations", "ark-r1cs-std", "hashbrown", "ark-sponge/r1cs"]
print-trace = [ "ark-std/print-trace" ]
parallel = [ "std", "ark-ff/parallel", "ark-ec/parallel", "ark-poly/parallel", "ark-std/parallel", "rayon" ]
default = ["asm", "std", "parallel"]
asm = ["ark-ff/asm"]
profile = []
parallel = ["std", "ark-ff/parallel", "ark-ec/parallel", "ark-poly/parallel", "ark-std/parallel", "rayon"]
print-trace = ["ark-std/print-trace"]
r1cs = ["ark-relations", "ark-r1cs-std", "ark-nonnative-field", "hashbrown"]
std = ["ark-ff/std", "ark-ec/std", "ark-nonnative-field/std", "ark-poly/std", "ark-std/std", "ark-relations/std", "ark-serialize/std"]
107 changes: 0 additions & 107 deletions src/README.md

This file was deleted.

61 changes: 0 additions & 61 deletions src/challenge.rs

This file was deleted.

8 changes: 3 additions & 5 deletions src/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ use crate::{
PolynomialCommitment, String, Vec,
};
use ark_ff::PrimeField;
use ark_nonnative_field::NonNativeFieldVar;
use ark_poly::Polynomial;
use ark_r1cs_std::fields::nonnative::NonNativeFieldVar;
use ark_r1cs_std::{fields::fp::FpVar, prelude::*};
use ark_relations::r1cs::{ConstraintSystemRef, Namespace, Result as R1CSResult, SynthesisError};
use ark_sponge::CryptographicSponge;
use ark_std::{borrow::Borrow, cmp::Eq, cmp::PartialEq, hash::Hash, marker::Sized};
use hashbrown::{HashMap, HashSet};

Expand Down Expand Up @@ -94,9 +93,8 @@ pub struct PCCheckRandomDataVar<TargetField: PrimeField, BaseField: PrimeField>
pub trait PCCheckVar<
PCF: PrimeField,
P: Polynomial<PCF>,
PC: PolynomialCommitment<PCF, P, S>,
PC: PolynomialCommitment<PCF, P>,
ConstraintF: PrimeField,
S: CryptographicSponge,
>: Clone
{
/// An allocated version of `PC::VerifierKey`.
Expand All @@ -119,7 +117,7 @@ pub trait PCCheckVar<
type ProofVar: AllocVar<PC::Proof, ConstraintF> + Clone;

/// An allocated version of `PC::BatchLCProof`.
type BatchLCProofVar: AllocVar<BatchLCProof<PCF, PC::BatchProof>, ConstraintF> + Clone;
type BatchLCProofVar: AllocVar<BatchLCProof<PCF, P, PC>, ConstraintF> + Clone;

/// Add to `ConstraintSystemRef<ConstraintF>` new constraints that check that `proof_i` is a valid evaluation
/// proof at `point_i` for the polynomial in `commitment_i`.
Expand Down
Loading

0 comments on commit 0b0eec2

Please sign in to comment.