@@ -2,8 +2,11 @@ use ark_ff::{Field, PrimeField, ToConstraintField};
22
33use ark_relations:: r1cs:: { ConstraintSystemRef , Namespace , SynthesisError } ;
44
5- use crate :: fields:: fp:: { AllocatedFp , FpVar } ;
6- use crate :: { prelude:: * , Assignment , ToConstraintFieldGadget , Vec } ;
5+ use crate :: {
6+ fields:: fp:: { AllocatedFp , FpVar } ,
7+ prelude:: * ,
8+ Assignment , ToConstraintFieldGadget , Vec ,
9+ } ;
710use core:: { borrow:: Borrow , convert:: TryFrom } ;
811
912/// Represents an interpretation of 8 `Boolean` objects as an
@@ -335,9 +338,9 @@ impl<ConstraintF: Field> AllocVar<u8, ConstraintF> for UInt8<ConstraintF> {
335338 }
336339}
337340
338- /// Parses the `Vec<UInt8<ConstraintF>>` in fixed-sized `ConstraintF::MODULUS_BIT_SIZE - 1` chunks and
339- /// converts each chunk, which is assumed to be little-endian, to its `FpVar<ConstraintF>`
340- /// representation.
341+ /// Parses the `Vec<UInt8<ConstraintF>>` in fixed-sized
342+ /// `ConstraintF::MODULUS_BIT_SIZE - 1` chunks and converts each chunk, which is
343+ /// assumed to be little-endian, to its `FpVar<ConstraintF>` representation.
341344/// This is the gadget counterpart to the `[u8]` implementation of
342345/// [ToConstraintField](ark_ff::ToConstraintField).
343346impl < ConstraintF : PrimeField > ToConstraintFieldGadget < ConstraintF > for [ UInt8 < ConstraintF > ] {
@@ -360,13 +363,17 @@ impl<ConstraintF: PrimeField> ToConstraintFieldGadget<ConstraintF> for Vec<UInt8
360363#[ cfg( test) ]
361364mod test {
362365 use super :: UInt8 ;
363- use crate :: fields:: fp:: FpVar ;
364- use crate :: prelude:: AllocationMode :: { Constant , Input , Witness } ;
365- use crate :: { prelude:: * , ToConstraintFieldGadget , Vec } ;
366+ use crate :: {
367+ fields:: fp:: FpVar ,
368+ prelude:: {
369+ AllocationMode :: { Constant , Input , Witness } ,
370+ * ,
371+ } ,
372+ ToConstraintFieldGadget , Vec ,
373+ } ;
366374 use ark_ff:: { PrimeField , ToConstraintField } ;
367375 use ark_relations:: r1cs:: { ConstraintSystem , SynthesisError } ;
368- use ark_std:: rand:: distributions:: Uniform ;
369- use ark_std:: rand:: Rng ;
376+ use ark_std:: rand:: { distributions:: Uniform , Rng } ;
370377 use ark_test_curves:: bls12_381:: Fr ;
371378
372379 #[ test]
0 commit comments