Skip to content

Commit

Permalink
update bandersnatch
Browse files Browse the repository at this point in the history
  • Loading branch information
qiweiii committed Jul 30, 2024
1 parent 32163d4 commit a9d40b6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
38 changes: 22 additions & 16 deletions Utils/Sources/bandersnatch/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Utils/Sources/bandersnatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 1 addition & 6 deletions Utils/Sources/bandersnatch/src/bandersnatch_vrfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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");
Expand Down

0 comments on commit a9d40b6

Please sign in to comment.