Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit revision for ring-proof #93

Merged
merged 1 commit into from
Jul 24, 2024
Merged
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
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
Loading