From 81eb230a627acf66540c3f18ac19fb9c5ef4ca88 Mon Sep 17 00:00:00 2001 From: tyshkor Date: Mon, 20 Mar 2023 12:47:56 +0100 Subject: [PATCH] fmt --- rln/src/protocol.rs | 9 ++++----- rln/src/public.rs | 6 ++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/rln/src/protocol.rs b/rln/src/protocol.rs index dc40e91..1bd1cfb 100644 --- a/rln/src/protocol.rs +++ b/rln/src/protocol.rs @@ -1,10 +1,7 @@ // This crate collects all the underlying primitives used to implement RLN use ark_circom::{CircomReduction, WitnessCalculator}; -use ark_groth16::{ - Groth16, prepare_verifying_key, - Proof as ArkProof, ProvingKey, VerifyingKey, -}; +use ark_groth16::{prepare_verifying_key, Groth16, Proof as ArkProof, ProvingKey, VerifyingKey}; use ark_relations::r1cs::ConstraintMatrices; use ark_relations::r1cs::SynthesisError; use ark_std::{rand::thread_rng, UniformRand}; @@ -541,7 +538,9 @@ pub enum ProofError { SynthesisError(#[from] SynthesisError), } -fn calculate_witness_element(witness: Vec) -> Result> { +fn calculate_witness_element( + witness: Vec, +) -> Result> { use ark_ff::PrimeField; let modulus = ::MODULUS; diff --git a/rln/src/public.rs b/rln/src/public.rs index f58bf58..421aec9 100644 --- a/rln/src/public.rs +++ b/rln/src/public.rs @@ -598,7 +598,8 @@ impl RLN<'_> { let mut serialized: Vec = Vec::new(); input_data.read_to_end(&mut serialized)?; let mut all_read = 0; - let proof = ArkProof::deserialize_compressed(&mut Cursor::new(&serialized[..128].to_vec()))?; + let proof = + ArkProof::deserialize_compressed(&mut Cursor::new(&serialized[..128].to_vec()))?; all_read += 128; let (proof_values, read) = deserialize_proof_values(&serialized[all_read..]); all_read += read; @@ -673,7 +674,8 @@ impl RLN<'_> { let mut serialized: Vec = Vec::new(); input_data.read_to_end(&mut serialized)?; let mut all_read = 0; - let proof = ArkProof::deserialize_compressed(&mut Cursor::new(&serialized[..128].to_vec()))?; + let proof = + ArkProof::deserialize_compressed(&mut Cursor::new(&serialized[..128].to_vec()))?; all_read += 128; let (proof_values, read) = deserialize_proof_values(&serialized[all_read..]); all_read += read;