Skip to content

Commit b5afd7b

Browse files
committed
fix: remove unnecessary generic from ArrayX.__normalize_limbs()
1 parent 3863285 commit b5afd7b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/runtime_bignum.nr

+3-3
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl<let N: u32, Params> BigNum<N, Params> where Params: BigNumParamsTrait<N> {
283283
}
284284
}
285285

286-
impl<let N: u32, Params,> BigNumInstanceTrait<BigNum<N, Params>> for BigNumInstance<N, Params> where Params: BigNumParamsTrait<N> {
286+
impl<let N: u32, Params> BigNumInstanceTrait<BigNum<N, Params>> for BigNumInstance<N, Params> where Params: BigNumParamsTrait<N> {
287287

288288
fn modulus(self) -> BigNum<N, Params> { BigNum{ limbs: self.modulus } }
289289
fn __derive_from_seed<let SeedBytes: u32>(self, seed: [u8; SeedBytes]) -> BigNum<N, Params> {
@@ -1271,7 +1271,7 @@ impl<let N: u32, Params> BigNumInstance<N, Params> where Params: BigNumParamsTra
12711271

12721272
for i in 0..NUM_PRODUCTS {
12731273
lhs[i] = self.__add_linear_expression(lhs_terms[i], lhs_flags[i]);
1274-
rhs[i]= self.__add_linear_expression(rhs_terms[i], rhs_flags[i]);
1274+
rhs[i] = self.__add_linear_expression(rhs_terms[i], rhs_flags[i]);
12751275
}
12761276

12771277
let add: [Field; N] = self.__add_linear_expression(linear_terms, linear_flags);
@@ -1373,7 +1373,7 @@ impl<let N: u32, Params> BigNumInstance<N, Params> where Params: BigNumParamsTra
13731373
linear_terms,
13741374
linear_flags
13751375
);
1376-
let mut mulout_n: ArrayX<Field, N,2> = ArrayX::new();
1376+
let mut mulout_n: ArrayX<Field, N, 2> = ArrayX::new();
13771377

13781378
let relation_result: ArrayX<Field, N, 2> = mulout_p.__normalize_limbs(N + N);
13791379
let modulus: [Field; N] = self.modulus;

src/utils/arrayX.nr

+6-3
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ impl<T, let N: u32, let SizeMultiplier: u32> ArrayX<T, N, SizeMultiplier> {
7474
let index = i % N;
7575
self.segments[segment][index]
7676
}
77+
}
78+
79+
impl<let N: u32, let SizeMultiplier: u32> ArrayX<Field, N, SizeMultiplier> {
7780

78-
unconstrained fn __normalize_limbs<let NumSegments: u32>(x: ArrayX<Field, N, NumSegments>, range: u32) -> ArrayX<Field, N, NumSegments> {
79-
let mut normalized: ArrayX<Field, N, NumSegments> = ArrayX::new();
80-
let mut inp = x;
81+
unconstrained fn __normalize_limbs(self, range: u32) -> Self {
82+
let mut normalized: Self = ArrayX::new();
83+
let mut inp = self;
8184
// (9 limb mul = 17 product terms)
8285

8386
// a2 a1 a0

0 commit comments

Comments
 (0)