Skip to content

Commit

Permalink
Remove some cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Jun 1, 2024
1 parent 89a7d03 commit 9b08463
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 deletions.
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ description = "EC VRFs with arkworks"
repository = "https://github.com/davxy/ark-ecvrf"

[dependencies]
ark-ec = { version = "0.4.2", default-features = false }
ark-ff = { version = "0.4.2", default-features = false }
ark-std = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4.2", default-features = false }
rand_core = { version = "0.6.4", default-features = false, optional = true }
rand_chacha = { version = "0.3.1", default-features = false }
ark-ec = { version = "0.4", default-features = false }
ark-ff = { version = "0.4", default-features = false }
ark-std = { version = "0.4", default-features = false }
ark-serialize = { version = "0.4", default-features = false }
rand_core = { version = "0.6", default-features = false, optional = true }
rand_chacha = { version = "0.3", default-features = false }
rayon = { version = "1.10", default-features = false, optional = true }
zeroize = { version = "1.7.0", default-features = false }
hmac = {version = "0.12.1", default-features = false, optional = true }
digest = { version = "0.10.7", default-features = false }
zeroize = { version = "1.8", default-features = false }
hmac = {version = "0.12", default-features = false, optional = true }
digest = { version = "0.10", default-features = false }
merlin = { version = "3.0", default-features = false, optional = true }
# Curves
ark-secp256r1 = { version = "0.4.0", default-features = false, optional = true }
ark-ed25519 = { version = "0.4.0", default-features = false, optional = true }
ark-ed-on-bls12-381-bandersnatch = { version = "0.4.0", default-features = false, optional = true }
ark-bls12-381 = { version = "0.4.0", default-features = false, optional = true }
# Hashing
sha2 = { version = "0.10.8", default-features = false }
sha2 = { version = "0.10", default-features = false }
# Ring VRF (waiting for crates.io)
fflonk = { git = "https://github.com/w3f/fflonk", default-features = false, optional = true }
ring-proof = { package = "ring", git = "https://github.com/w3f/ring-proof", default-features = false, optional = true }
merlin = { version = "3.0.0", default-features = false, optional = true }
ring-proof = { package = "ring", git = "https://github.com/w3f/ring-proof", rev = "b273d33", default-features = false, optional = true }

[dev-dependencies]
ark-ed25519 = "0.4.0"
hex = "0.4.3"
ark-ed25519 = "0.4"
hex = "0.4"

[features]
default = [ "std" ]
Expand Down
25 changes: 10 additions & 15 deletions src/ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,25 @@ type Pcs<S> = fflonk::pcs::kzg::KZG<<S as RingSuite>::Pairing>;
/// Basically the powers of tau URS.
type PcsParams<S> = fflonk::pcs::kzg::urs::URS<<S as RingSuite>::Pairing>;

type PairingScalarField<S> = <<S as RingSuite>::Pairing as ark_ec::pairing::Pairing>::ScalarField;
pub type ProverKey<S> =
ring_proof::ProverKey<BaseField<S>, Pcs<S>, ark_ec::short_weierstrass::Affine<CurveConfig<S>>>;

pub type ProverKey<S> = ring_proof::ProverKey<
PairingScalarField<S>,
Pcs<S>,
ark_ec::short_weierstrass::Affine<CurveConfig<S>>,
>;
pub type VerifierKey<S> = ring_proof::VerifierKey<BaseField<S>, Pcs<S>>;

pub type VerifierKey<S> = ring_proof::VerifierKey<PairingScalarField<S>, Pcs<S>>;

pub type RingProver<S> =
ring_proof::ring_prover::RingProver<PairingScalarField<S>, Pcs<S>, CurveConfig<S>>;
pub type RingProver<S> = ring_proof::ring_prover::RingProver<BaseField<S>, Pcs<S>, CurveConfig<S>>;

pub type RingVerifier<S> =
ring_proof::ring_verifier::RingVerifier<PairingScalarField<S>, Pcs<S>, CurveConfig<S>>;
ring_proof::ring_verifier::RingVerifier<BaseField<S>, Pcs<S>, CurveConfig<S>>;

pub type RingProof<S> = ring_proof::RingProof<PairingScalarField<S>, Pcs<S>>;
pub type RingProof<S> = ring_proof::RingProof<BaseField<S>, Pcs<S>>;

pub type PiopParams<S> = ring_proof::PiopParams<PairingScalarField<S>, CurveConfig<S>>;
pub type PiopParams<S> = ring_proof::PiopParams<BaseField<S>, CurveConfig<S>>;

#[derive(Clone, CanonicalSerialize, CanonicalDeserialize)]
pub struct Proof<S: RingSuite>
where
BaseField<S>: ark_ff::PrimeField,
CurveConfig<S>: SWCurveConfig,
{
pub pedersen_proof: PedersenProof<S>,
pub ring_proof: RingProof<S>,
Expand Down Expand Up @@ -188,15 +183,15 @@ where
prover_key,
self.piop_params.clone(),
key_index,
merlin::Transcript::new(b"ring-vrf"),
merlin::Transcript::new(b""),
)
}

pub fn verifier(&self, verifier_key: VerifierKey<S>) -> RingVerifier<S> {
RingVerifier::<S>::init(
verifier_key,
self.piop_params.clone(),
merlin::Transcript::new(b"ring-vrf"),
merlin::Transcript::new(b""),
)
}
}
Expand Down

0 comments on commit 9b08463

Please sign in to comment.