From a9d40b6f5ff4abf85a723647745b3c1f4cfc0f41 Mon Sep 17 00:00:00 2001 From: Qiwei Yang Date: Tue, 30 Jul 2024 09:31:27 +0800 Subject: [PATCH] update bandersnatch --- Utils/Sources/bandersnatch/Cargo.lock | 38 +++++++++++-------- Utils/Sources/bandersnatch/Cargo.toml | 2 +- .../bandersnatch/src/bandersnatch_vrfs.rs | 7 +--- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Utils/Sources/bandersnatch/Cargo.lock b/Utils/Sources/bandersnatch/Cargo.lock index 20b11143..e9f7c1c9 100644 --- a/Utils/Sources/bandersnatch/Cargo.lock +++ b/Utils/Sources/bandersnatch/Cargo.lock @@ -47,7 +47,7 @@ dependencies = [ [[package]] name = "ark-ec-vrfs" version = "0.1.0" -source = "git+https://github.com/davxy/ark-ec-vrfs#ced8b9ccdb6f67de2c2cbacf92b0515f9d359ba4" +source = "git+https://github.com/davxy/ark-ec-vrfs?rev=8cef209#8cef20972fd808780f0462c28162b3030a195460" dependencies = [ "ark-bls12-381", "ark-ec", @@ -56,8 +56,6 @@ dependencies = [ "ark-serialize", "ark-std", "digest", - "fflonk", - "merlin", "rand_chacha", "rayon", "ring", @@ -171,9 +169,9 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" @@ -306,7 +304,7 @@ dependencies = [ [[package]] name = "common" version = "0.1.0" -source = "git+https://github.com/davxy/ring-proof?branch=extended#1d89434da560faec43dd27a2f94947f3ebd07d4d" +source = "git+https://github.com/davxy/ring-proof?branch=extended#6524d3a17b2ddadcfca2f2934d3aed7bb129fa9f" dependencies = [ "ark-ec", "ark-ff", @@ -548,6 +546,12 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + [[package]] name = "merlin" version = "3.0.0" @@ -683,13 +687,14 @@ dependencies = [ [[package]] name = "ring" version = "0.1.0" -source = "git+https://github.com/davxy/ring-proof?branch=extended#1d89434da560faec43dd27a2f94947f3ebd07d4d" +source = "git+https://github.com/davxy/ring-proof?branch=extended#6524d3a17b2ddadcfca2f2934d3aed7bb129fa9f" dependencies = [ "ark-ec", "ark-ff", "ark-poly", "ark-serialize", "ark-std", + "arrayvec", "blake2", "common", "fflonk", @@ -748,16 +753,17 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -798,9 +804,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.69" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201fcda3845c23e8212cd466bfebf0bd20694490fc0356ae8e428e0824a915a6" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -857,9 +863,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" @@ -988,7 +994,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.72", ] [[package]] @@ -1008,5 +1014,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.72", ] diff --git a/Utils/Sources/bandersnatch/Cargo.toml b/Utils/Sources/bandersnatch/Cargo.toml index aea8334c..9b628d2e 100644 --- a/Utils/Sources/bandersnatch/Cargo.toml +++ b/Utils/Sources/bandersnatch/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["staticlib"] cbindgen = "0.24.0" [dependencies] -ark-ec-vrfs = { git = "https://github.com/davxy/ark-ec-vrfs", default-features = false, features = [ +ark-ec-vrfs = { git = "https://github.com/davxy/ark-ec-vrfs", rev = "8cef209", features = [ "bandersnatch", "ring", "parallel", diff --git a/Utils/Sources/bandersnatch/src/bandersnatch_vrfs.rs b/Utils/Sources/bandersnatch/src/bandersnatch_vrfs.rs index 3bc0130d..d084c425 100644 --- a/Utils/Sources/bandersnatch/src/bandersnatch_vrfs.rs +++ b/Utils/Sources/bandersnatch/src/bandersnatch_vrfs.rs @@ -139,9 +139,7 @@ impl Verifier { aux_data: &[u8], signature: &[u8], ) -> Result<[u8; 32], ()> { - use ark_ec_vrfs::ring::prelude::fflonk::pcs::PcsParams; use ark_ec_vrfs::ring::Verifier as _; - use bandersnatch::VerifierKey; let signature = RingVrfSignature::deserialize_compressed(signature).unwrap(); @@ -155,10 +153,7 @@ impl Verifier { // As an alternative we can construct the verifier key using the // RingContext::verifier_key() method, but is more expensive. // In other words, we prefer computing the commitment once, when the keyset changes. - let verifier_key = VerifierKey::from_commitment_and_kzg_vk( - self.commitment.clone(), - ring_ctx.pcs_params.raw_vk(), - ); + let verifier_key = ring_ctx.verifier_key_from_commitment(self.commitment.clone()); let verifier = ring_ctx.verifier(verifier_key); if Public::verify(input, output, aux_data, &signature.proof, &verifier).is_err() { println!("Ring signature verification failure");