From 6f4f56b0b0d0b1b810df9dfdfa37a7afd76730d7 Mon Sep 17 00:00:00 2001 From: Davide Galassi Date: Wed, 24 Jul 2024 16:05:58 +0200 Subject: [PATCH] Add explicit revision for ring-proof Remove direct dependency on fflonk and merlin --- bandersnatch_vrfs/Cargo.toml | 5 +---- bandersnatch_vrfs/src/ring.rs | 13 +++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/bandersnatch_vrfs/Cargo.toml b/bandersnatch_vrfs/Cargo.toml index b604c48..2aa8803 100644 --- a/bandersnatch_vrfs/Cargo.toml +++ b/bandersnatch_vrfs/Cargo.toml @@ -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 } diff --git a/bandersnatch_vrfs/src/ring.rs b/bandersnatch_vrfs/src/ring.rs index 51ddc42..91d42aa 100644 --- a/bandersnatch_vrfs/src/ring.rs +++ b/bandersnatch_vrfs/src/ring.rs @@ -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; +type RealKZG = ring::pcs::kzg::KZG; -type PcsParams = fflonk::pcs::kzg::urs::URS; +type PcsParams = ring::pcs::kzg::urs::URS; pub type PiopParams = ring::PiopParams; pub type RingProof = ring::RingProof; @@ -29,7 +26,7 @@ pub type RingVerifier = ring::ring_verifier::RingVerifier pub type ProverKey = ring::ProverKey; pub type VerifierKey = ring::VerifierKey; -pub type KzgVk = fflonk::pcs::kzg::params::RawKzgVerifierKey; +pub type KzgVk = ring::pcs::kzg::params::RawKzgVerifierKey; pub type RingCommitment = Ring; @@ -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], };