diff --git a/src/fields/fp/mod.rs b/src/fields/fp/mod.rs index 693093c..d6e035c 100644 --- a/src/fields/fp/mod.rs +++ b/src/fields/fp/mod.rs @@ -876,7 +876,8 @@ impl ToBitsGadget for FpVar { fn to_non_unique_bits_le(&self) -> Result>, SynthesisError> { use ark_ff::BitIteratorLE; match self { - Self::Constant(c) => Ok(BitIteratorLE::without_trailing_zeros(&c.into_repr()) + Self::Constant(c) => Ok(BitIteratorLE::new(&c.into_repr()) + .take((F::Params::MODULUS_BITS) as usize) .map(Boolean::constant) .collect::>()), Self::Var(v) => v.to_non_unique_bits_le(),