Skip to content

Commit

Permalink
Fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratyush committed Jan 18, 2024
1 parent 734e615 commit 61221ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cmp.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ark_ff::{Field, PrimeField};
use ark_relations::r1cs::SynthesisError;

use crate::{boolean::Boolean, R1CSVar, eq::EqGadget};
use crate::{boolean::Boolean, eq::EqGadget, R1CSVar};

/// Specifies how to generate constraints for comparing two variables.
pub trait CmpGadget<F: Field>: R1CSVar<F> + EqGadget<F> {
Expand Down
14 changes: 9 additions & 5 deletions src/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ impl<T: EqGadget<F> + R1CSVar<F>, F: PrimeField> EqGadget<F> for Vec<T> {
other: &Self,
condition: &Boolean<F>,
) -> Result<(), SynthesisError> {
self.as_slice().conditional_enforce_equal(other.as_slice(), condition)
self.as_slice()
.conditional_enforce_equal(other.as_slice(), condition)
}

#[tracing::instrument(target = "r1cs", skip(self, other))]
Expand All @@ -155,7 +156,8 @@ impl<T: EqGadget<F> + R1CSVar<F>, F: PrimeField> EqGadget<F> for Vec<T> {
other: &Self,
should_enforce: &Boolean<F>,
) -> Result<(), SynthesisError> {
self.as_slice().conditional_enforce_not_equal(other.as_slice(), should_enforce)
self.as_slice()
.conditional_enforce_not_equal(other.as_slice(), should_enforce)
}
}

Expand Down Expand Up @@ -205,7 +207,8 @@ impl<T: EqGadget<F> + R1CSVar<F>, F: PrimeField, const N: usize> EqGadget<F> for
other: &Self,
condition: &Boolean<F>,
) -> Result<(), SynthesisError> {
self.as_slice().conditional_enforce_equal(other.as_slice(), condition)
self.as_slice()
.conditional_enforce_equal(other.as_slice(), condition)
}

#[tracing::instrument(target = "r1cs", skip(self, other))]
Expand All @@ -214,6 +217,7 @@ impl<T: EqGadget<F> + R1CSVar<F>, F: PrimeField, const N: usize> EqGadget<F> for
other: &Self,
should_enforce: &Boolean<F>,
) -> Result<(), SynthesisError> {
self.as_slice().conditional_enforce_not_equal(other.as_slice(), should_enforce)
self.as_slice()
.conditional_enforce_not_equal(other.as_slice(), should_enforce)
}
}
}
2 changes: 0 additions & 2 deletions src/uint/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ impl<const N: usize, T: PrimUInt, ConstraintF: Field> ToBytesGadget<ConstraintF>
}
}



#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 61221ab

Please sign in to comment.