Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resolver = "2"
members = [
# "evm-vrfier",
"pasta-tree",
# "pasta-tree",
"w3f-plonk-common",
"w3f-ring-proof",
# "w3f-ring-vrf-snark",
Expand Down
1 change: 1 addition & 0 deletions w3f-plonk-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ parallel = [
print-trace = ["ark-std/print-trace"]
asm = ["w3f-pcs/asm"]
test-vectors = []
twisted_edwards = []
3 changes: 3 additions & 0 deletions w3f-plonk-common/src/gadgets/ec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::marker::PhantomData;
use ark_std::vec::Vec;

#[cfg(not(feature = "twisted_edwards"))]
pub mod sw_cond_add;
#[cfg(feature = "twisted_edwards")]
pub mod te_cond_add;
#[cfg(feature = "twisted_edwards")]
pub mod te_doubling;

// A vec of affine points from the prime-order subgroup of the curve whose base field enables FFTs,
Expand Down
37 changes: 19 additions & 18 deletions w3f-ring-proof/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,27 @@ name = "ring_proof"
harness = false

[features]
default = [ "std" ]
default = ["std", "twisted_edwards"]
std = [
"ark-std/std",
"ark-ff/std",
"ark-ec/std",
"ark-poly/std",
"ark-serialize/std",
"w3f-pcs/std",
"w3f-plonk-common/std"
"ark-std/std",
"ark-ff/std",
"ark-ec/std",
"ark-poly/std",
"ark-serialize/std",
"w3f-pcs/std",
"w3f-plonk-common/std"
]
parallel = [
"std",
"rayon",
"ark-std/parallel",
"ark-ff/parallel",
"ark-ec/parallel",
"ark-poly/parallel",
"w3f-plonk-common/parallel",
"w3f-pcs/parallel"
"std",
"rayon",
"ark-std/parallel",
"ark-ff/parallel",
"ark-ec/parallel",
"ark-poly/parallel",
"w3f-plonk-common/parallel",
"w3f-pcs/parallel"
]
print-trace = ["ark-std/print-trace"]
asm = [ "w3f-pcs/asm" ]
test-vectors = [ "w3f-plonk-common/test-vectors" ]
asm = ["w3f-pcs/asm"]
test-vectors = ["w3f-plonk-common/test-vectors"]
twisted_edwards = ["w3f-plonk-common/twisted_edwards"]
8 changes: 6 additions & 2 deletions w3f-ring-proof/src/piop/prover.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use ark_ec::short_weierstrass::{Affine as SwAffine, SWCurveConfig};
use ark_ec::twisted_edwards::{Affine as TeAffine, TECurveConfig};
use ark_ec::AffineRepr;
use ark_ff::PrimeField;
use ark_poly::univariate::DensePolynomial;
Expand Down Expand Up @@ -140,6 +138,9 @@ impl<F: PrimeField, G: AffineRepr<BaseField = F>> PiopProver<F, G> {
}
}

#[cfg(feature = "twisted_edwards")]
use ark_ec::twisted_edwards::{Affine as TeAffine, TECurveConfig};
#[cfg(feature = "twisted_edwards")]
impl<F, C, Curve> ProverPiop<F, C> for PiopProver<F, TeAffine<Curve>>
where
F: PrimeField,
Expand Down Expand Up @@ -202,6 +203,9 @@ where
}
}

#[cfg(not(feature = "twisted_edwards"))]
use ark_ec::short_weierstrass::{Affine as SwAffine, SWCurveConfig};
#[cfg(not(feature = "twisted_edwards"))]
impl<F, C, Curve> ProverPiop<F, C> for PiopProver<F, SwAffine<Curve>>
where
F: PrimeField,
Expand Down
8 changes: 6 additions & 2 deletions w3f-ring-proof/src/piop/verifier.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use ark_ec::short_weierstrass::{Affine as SwAffine, SWCurveConfig};
use ark_ec::twisted_edwards::{Affine as TeAffine, TECurveConfig};
use ark_ec::AffineRepr;
use ark_ff::PrimeField;
use ark_std::marker::PhantomData;
Expand Down Expand Up @@ -102,6 +100,9 @@ impl<F: PrimeField, C: Commitment<F>, P: AffineRepr<BaseField = F>> PiopVerifier
}
}

#[cfg(feature = "twisted_edwards")]
use ark_ec::twisted_edwards::{Affine as TeAffine, TECurveConfig};
#[cfg(feature = "twisted_edwards")]
impl<F: PrimeField, C: Commitment<F>, Jubjub: TECurveConfig<BaseField = F>> VerifierPiop<F, C>
for PiopVerifier<F, C, TeAffine<Jubjub>>
{
Expand Down Expand Up @@ -150,6 +151,9 @@ impl<F: PrimeField, C: Commitment<F>, Jubjub: TECurveConfig<BaseField = F>> Veri
}
}

#[cfg(not(feature = "twisted_edwards"))]
use ark_ec::short_weierstrass::{Affine as SwAffine, SWCurveConfig};
#[cfg(not(feature = "twisted_edwards"))]
impl<F: PrimeField, C: Commitment<F>, Jubjub: SWCurveConfig<BaseField = F>> VerifierPiop<F, C>
for PiopVerifier<F, C, SwAffine<Jubjub>>
{
Expand Down
Loading