Skip to content

Commit

Permalink
Add explicit revision for ring-proof
Browse files Browse the repository at this point in the history
Remove direct dependency on fflonk and merlin
  • Loading branch information
davxy committed Jul 24, 2024
1 parent 5821f59 commit 6f4f56b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
5 changes: 1 addition & 4 deletions bandersnatch_vrfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ ark-ff.workspace = true
ark-ec.workspace = true
ark-serialize.workspace = true

fflonk = { git = "https://github.com/w3f/fflonk" }
ring = { git = "https://github.com/w3f/ring-proof" }

merlin = { version = "3.0", default-features = false }
ring = { git = "https://github.com/w3f/ring-proof", rev = "665f5f5" }

# In these three, add optional = true here only if we create some related curves trait.
ark-ed-on-bls12-381-bandersnatch = { version = "0.4", default-features = false }
Expand Down
13 changes: 5 additions & 8 deletions bandersnatch_vrfs/src/ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ use ark_serialize::{
Validate, Write,
};
use ark_std::{rand::{Rng, SeedableRng}, vec};
use fflonk::pcs::PCS;
use merlin::Transcript;
use ring::Domain;
use ring::ring::Ring;
use ring::{Transcript, pcs::PCS, Domain, ring::Ring};

use crate::bandersnatch::{Fq, SWAffine, SWConfig, BandersnatchConfig};
use crate::bls12_381::Bls12_381;
use crate::bls12_381;

type RealKZG = fflonk::pcs::kzg::KZG<Bls12_381>;
type RealKZG = ring::pcs::kzg::KZG<Bls12_381>;

type PcsParams = fflonk::pcs::kzg::urs::URS<Bls12_381>;
type PcsParams = ring::pcs::kzg::urs::URS<Bls12_381>;

pub type PiopParams = ring::PiopParams<Fq, SWConfig>;
pub type RingProof = ring::RingProof<Fq, RealKZG>;
Expand All @@ -29,7 +26,7 @@ pub type RingVerifier = ring::ring_verifier::RingVerifier<Fq, RealKZG, SWConfig>
pub type ProverKey = ring::ProverKey<Fq, RealKZG, SWAffine>;
pub type VerifierKey = ring::VerifierKey<Fq, RealKZG>;

pub type KzgVk = fflonk::pcs::kzg::params::RawKzgVerifierKey<Bls12_381>;
pub type KzgVk = ring::pcs::kzg::params::RawKzgVerifierKey<Bls12_381>;

pub type RingCommitment = Ring<bls12_381::Fr, Bls12_381, BandersnatchConfig>;

Expand Down Expand Up @@ -96,7 +93,7 @@ impl KZG {

pub fn kzg_setup(domain_size: usize, srs: StaticProverKey) -> Self {
let piop_params = make_piop_params(domain_size);
let pcs_params = fflonk::pcs::kzg::urs::URS {
let pcs_params = ring::pcs::kzg::urs::URS {
powers_in_g1: srs.mon_g1,
powers_in_g2: vec![srs.kzg_vk.g2, srs.kzg_vk.tau_in_g2],
};
Expand Down

0 comments on commit 6f4f56b

Please sign in to comment.