mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-10 16:01:28 +01:00
Runs rustfmt on the repo
This commit is contained in:
committed by
Pratyush Mishra
parent
a3e1cd6cf2
commit
b26867f267
@@ -13,9 +13,9 @@ use std::{borrow::Borrow, marker::PhantomData};
|
||||
#[derive(Derivative)]
|
||||
#[derivative(Clone(bound = "G: Group, W: PedersenWindow, ConstraintF: Field"))]
|
||||
pub struct PedersenCommitmentGadgetParameters<G: Group, W: PedersenWindow, ConstraintF: Field> {
|
||||
params: PedersenParameters<G>,
|
||||
params: PedersenParameters<G>,
|
||||
#[doc(hidden)]
|
||||
_group: PhantomData<G>,
|
||||
_group: PhantomData<G>,
|
||||
#[doc(hidden)]
|
||||
_engine: PhantomData<ConstraintF>,
|
||||
#[doc(hidden)]
|
||||
|
||||
@@ -122,8 +122,10 @@ impl<G: Group, W: PedersenWindow> FixedLengthCRH for BoweHopwoodPedersenCRH<G, W
|
||||
}
|
||||
assert_eq!(CHUNK_SIZE, 3);
|
||||
|
||||
// Compute sum of h_i^{sum of (1-2*c_{i,j,2})*(1+c_{i,j,0}+2*c_{i,j,1})*2^{4*(j-1)} for all j in segment} for all i.
|
||||
// Described in section 5.4.1.7 in the Zcash protocol specification.
|
||||
// Compute sum of h_i^{sum of
|
||||
// (1-2*c_{i,j,2})*(1+c_{i,j,0}+2*c_{i,j,1})*2^{4*(j-1)} for all j in segment}
|
||||
// for all i. Described in section 5.4.1.7 in the Zcash protocol
|
||||
// specification.
|
||||
let result = padded_input
|
||||
.par_chunks(W::WINDOW_SIZE * CHUNK_SIZE)
|
||||
.zip(¶meters.generators)
|
||||
|
||||
@@ -26,11 +26,11 @@ pub struct PedersenCRHGadgetParameters<
|
||||
|
||||
pub struct PedersenCRHGadget<G: Group, ConstraintF: Field, GG: GroupGadget<G, ConstraintF>> {
|
||||
#[doc(hideen)]
|
||||
_group: PhantomData<*const G>,
|
||||
_group: PhantomData<*const G>,
|
||||
#[doc(hideen)]
|
||||
_group_gadget: PhantomData<*const GG>,
|
||||
#[doc(hideen)]
|
||||
_engine: PhantomData<ConstraintF>,
|
||||
_engine: PhantomData<ConstraintF>,
|
||||
}
|
||||
|
||||
impl<ConstraintF, G, GG, W> FixedLengthCRHGadget<PedersenCRH<G, W>, ConstraintF>
|
||||
|
||||
@@ -200,7 +200,7 @@ impl<P: MerkleTreeConfig> MerkleHashTree<P> {
|
||||
|
||||
// Check that the given index corresponds to the correct leaf.
|
||||
if leaf_hash != self.tree[tree_index] {
|
||||
return Err(MerkleTreeError::IncorrectLeafIndex(tree_index).into())
|
||||
return Err(MerkleTreeError::IncorrectLeafIndex(tree_index).into());
|
||||
}
|
||||
|
||||
// Iterate from the leaf up to the root, storing all intermediate hash values.
|
||||
@@ -230,7 +230,7 @@ impl<P: MerkleTreeConfig> MerkleHashTree<P> {
|
||||
}
|
||||
end_timer!(prove_time);
|
||||
if path.len() != (Self::HEIGHT - 1) as usize {
|
||||
return Err(MerkleTreeError::IncorrectPathLength(path.len()).into())
|
||||
return Err(MerkleTreeError::IncorrectPathLength(path.len()).into());
|
||||
} else {
|
||||
Ok(MerkleTreePath { path })
|
||||
}
|
||||
@@ -371,8 +371,7 @@ mod test {
|
||||
crh::{pedersen::*, *},
|
||||
merkle_tree::*,
|
||||
};
|
||||
use algebra::curves::jubjub::JubJubAffine as JubJub;
|
||||
use algebra::Zero;
|
||||
use algebra::{curves::jubjub::JubJubAffine as JubJub, Zero};
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ pub struct Gm17<
|
||||
V: ToConstraintField<E::Fr> + ?Sized,
|
||||
> {
|
||||
#[doc(hidden)]
|
||||
_engine: PhantomData<E>,
|
||||
_engine: PhantomData<E>,
|
||||
#[doc(hidden)]
|
||||
_circuit: PhantomData<C>,
|
||||
_circuit: PhantomData<C>,
|
||||
#[doc(hidden)]
|
||||
_verifier_input: PhantomData<V>,
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ pub struct Groth16<
|
||||
V: ToConstraintField<E::Fr> + ?Sized,
|
||||
> {
|
||||
#[doc(hidden)]
|
||||
_engine: PhantomData<E>,
|
||||
_engine: PhantomData<E>,
|
||||
#[doc(hidden)]
|
||||
_circuit: PhantomData<C>,
|
||||
_circuit: PhantomData<C>,
|
||||
#[doc(hidden)]
|
||||
_verifier_input: PhantomData<V>,
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ mod test {
|
||||
#[test]
|
||||
fn test_gm17() {
|
||||
use crate::nizk::{gm17::Gm17, NIZK};
|
||||
use algebra::{curves::bls12_381::Bls12_381, fields::bls12_381::Fr};
|
||||
use algebra::One;
|
||||
use algebra::{curves::bls12_381::Bls12_381, fields::bls12_381::Fr, One};
|
||||
use r1cs_core::{ConstraintSynthesizer, ConstraintSystem, SynthesisError};
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
|
||||
@@ -38,18 +38,18 @@ impl<G: Group, ConstraintF: Field, GG: GroupGadget<G, ConstraintF>> Clone
|
||||
pub struct SchnorrSigGadgetPk<G: Group, ConstraintF: Field, GG: GroupGadget<G, ConstraintF>> {
|
||||
pub_key: GG,
|
||||
#[doc(hidden)]
|
||||
_group: PhantomData<*const G>,
|
||||
_group: PhantomData<*const G>,
|
||||
#[doc(hidden)]
|
||||
_engine: PhantomData<*const ConstraintF>,
|
||||
}
|
||||
|
||||
pub struct SchnorrRandomizePkGadget<G: Group, ConstraintF: Field, GG: GroupGadget<G, ConstraintF>> {
|
||||
#[doc(hidden)]
|
||||
_group: PhantomData<*const G>,
|
||||
_group: PhantomData<*const G>,
|
||||
#[doc(hidden)]
|
||||
_group_gadget: PhantomData<*const GG>,
|
||||
#[doc(hidden)]
|
||||
_engine: PhantomData<*const ConstraintF>,
|
||||
_engine: PhantomData<*const ConstraintF>,
|
||||
}
|
||||
|
||||
impl<G, GG, D, ConstraintF> SigRandomizePkGadget<SchnorrSignature<G, D>, ConstraintF>
|
||||
|
||||
@@ -3,10 +3,9 @@ use algebra::{
|
||||
bytes::ToBytes,
|
||||
fields::{Field, PrimeField},
|
||||
groups::Group,
|
||||
to_bytes, ToConstraintField, UniformRand,
|
||||
to_bytes, One, ToConstraintField, UniformRand, Zero,
|
||||
};
|
||||
use digest::Digest;
|
||||
use algebra::{One, Zero};
|
||||
use rand::Rng;
|
||||
use std::{
|
||||
hash::Hash,
|
||||
|
||||
Reference in New Issue
Block a user