diff --git a/Nargo.toml b/Nargo.toml index 6b50c80..e6a7a19 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -5,4 +5,4 @@ authors = [""] compiler_version = ">=0.32.0" [dependencies] -bignum = {tag = "v0.2", git = "https://github.com/noir-lang/noir-bignum"} \ No newline at end of file +bignum = {tag = "v0.3.0", git = "https://github.com/noir-lang/noir-bignum"} \ No newline at end of file diff --git a/src/curve_jac.nr b/src/curve_jac.nr index 39d8d91..77aa59a 100644 --- a/src/curve_jac.nr +++ b/src/curve_jac.nr @@ -589,7 +589,7 @@ impl CurveJ where BigNum: BigNumTrait, (accumulator, affine_transcript) } - unconstrained fn compute_linear_expression_transcript( + unconstrained fn compute_linear_expression_transcript( mul_points: [BigCurve; NMuls], mul_scalars: [ScalarField; NMuls], add_points: [BigCurve; NAdds] @@ -679,7 +679,7 @@ impl CurveJ where BigNum: BigNumTrait, } } -struct LinearExpressionTranscript{ +struct LinearExpressionTranscript{ table_transcript: [[JTranscript; 8]; NMuls], msm_double_transcript: [[JTranscript; 4]; NScalarSlices], msm_add_transcript: [[JTranscript; NMuls]; NScalarSlices], @@ -688,7 +688,7 @@ struct LinearExpressionTranscript } -struct AffineLinearExpressionTranscript{ +struct AffineLinearExpressionTranscript{ table_transcript: [[AffineTranscript; 8]; NMuls], msm_double_transcript: [[AffineTranscript; 4]; NScalarSlices], msm_add_transcript: [[AffineTranscript; NMuls]; NScalarSlices], @@ -697,7 +697,7 @@ struct AffineLinearExpressionTranscript } -impl AffineLinearExpressionTranscript where BigNum: BigNumTrait, CurveParams: CurveParamsTrait { +impl AffineLinearExpressionTranscript where BigNum: BigNumTrait, CurveParams: CurveParamsTrait { unconstrained fn from_jtranscript(jtranscript: LinearExpressionTranscript) -> Self { let mut inverses: [BigNum] = &[]; @@ -776,7 +776,7 @@ impl LinearExpressionTranscript where BigNum: BigNumTrait, CurveParams: CurveParamsTrait {} +impl LinearExpressionTranscript where BigNum: BigNumTrait, CurveParams: CurveParamsTrait {} // TODO: this should probably be in bignum unconstrained pub fn batch_invert(x: &mut [BigNum]) where BigNum: BigNumTrait { diff --git a/src/lib.nr b/src/lib.nr index 57d2b7f..1c9c557 100644 --- a/src/lib.nr +++ b/src/lib.nr @@ -630,7 +630,7 @@ impl BigCurve where CurveParams: Curve accumulator } - unconstrained fn get_mul_transcript( + unconstrained fn get_mul_transcript( P: Self, scalar: ScalarField ) -> [AffineTranscript; 326] { @@ -638,13 +638,13 @@ impl BigCurve where CurveParams: Curve } // Expensive witness generation! Avoid if possible - fn mul(self, scalar: ScalarField) -> Self { + fn mul(self, scalar: ScalarField) -> Self { let transcript: [AffineTranscript; 326] = BigCurve::get_mul_transcript(self, scalar); self.mul_with_hint(scalar, transcript) } - fn evaluate_linear_expression( + fn evaluate_linear_expression( mut mul_points: [Self; NMuls], mut mul_scalars: [ScalarField; NMuls], add_points: [Self; NAdds] diff --git a/src/scalar_field.nr b/src/scalar_field.nr index 49bdc89..616b455 100644 --- a/src/scalar_field.nr +++ b/src/scalar_field.nr @@ -200,7 +200,7 @@ impl ScalarField { } // Note: I can't propagate ModulusBits or NumLimbs from a generic that satisfies BigNumTrait due to bugs, so we have to pass NumLimbs and Params in directly. disgusting! - fn from_bignum(x: BigNum) -> Self where Params: BigNumParamsTrait + RuntimeBigNumParamsTrait { + fn from_bignum(x: BigNum) -> Self where Params: BigNumParamsTrait + RuntimeBigNumParamsTrait { x.validate_in_field(); let mut (slices, skew): ([u8; N], bool) = get_wnaf_slices2(x.limbs);