From b03cc4fc67a84efe46104f9c885b8ad3cc3134cd Mon Sep 17 00:00:00 2001 From: Fitznik Date: Sun, 17 Nov 2024 20:21:09 -0500 Subject: [PATCH] Deleted the repetition --- .../implementations/implementation_u16.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/crates/boojum/src/gadgets/non_native_field/implementations/implementation_u16.rs b/crates/boojum/src/gadgets/non_native_field/implementations/implementation_u16.rs index f29509b..e419de5 100644 --- a/crates/boojum/src/gadgets/non_native_field/implementations/implementation_u16.rs +++ b/crates/boojum/src/gadgets/non_native_field/implementations/implementation_u16.rs @@ -136,22 +136,7 @@ where // well, we just mul by 1 let mut one: NonNativeFieldOverU16 = Self::allocated_constant(cs, T::one(), &self.params); - let mut normalized = self.mul(cs, &mut one); - - // assert that we only have "modulus limbs" moduluses in this element - assert_eq!(normalized.non_zero_limbs, normalized.params.modulus_limbs); - - // sub modulus - let modulus = self - .params - .modulus - .map(|el| cs.allocate_constant(F::from_u64_unchecked(el as u64))); - // for rare case when our modulus is exactly 16 * K bits, but we use larger representation - let els_to_skip = N - self.params.modulus_limbs; - let _ = - u16_long_subtraction_noborrow_must_borrow(cs, &normalized.limbs, &modulus, els_to_skip); - assert!(normalized.form == RepresentationForm::Normalized); - normalized.tracker.max_moduluses = 1; + let normalized = self.mul(cs, &mut one); // update self to normalized one *self = normalized;