mirror of
https://github.com/vacp2p/zerokit.git
synced 2025-02-20 18:28:16 +00:00
fmt
This commit is contained in:
parent
9bfef98813
commit
81eb230a62
@ -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<E: ark_ec::pairing::Pairing>(witness: Vec<BigInt>) -> Result<Vec<E::ScalarField>> {
|
||||
fn calculate_witness_element<E: ark_ec::pairing::Pairing>(
|
||||
witness: Vec<BigInt>,
|
||||
) -> Result<Vec<E::ScalarField>> {
|
||||
use ark_ff::PrimeField;
|
||||
let modulus = <E::ScalarField as PrimeField>::MODULUS;
|
||||
|
||||
|
@ -598,7 +598,8 @@ impl RLN<'_> {
|
||||
let mut serialized: Vec<u8> = 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<u8> = 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user