diff --git a/src/lib.nr b/src/lib.nr index 2aa4a8c..b5a08e4 100644 --- a/src/lib.nr +++ b/src/lib.nr @@ -324,7 +324,7 @@ impl Curve { let x2 = other.x; let y1 = self.y; let y2 = other.y; - let (x, y, lambda) = __add_unconstrained(x1, x2, y1, y2, a, d); + let (x, y, lambda) = unsafe { __add_unconstrained(x1, x2, y1, y2, a, d) }; let x1x2 = x1 * x2; let x1y2 = x1 * y2; std::as_witness(x1x2); @@ -349,7 +349,7 @@ impl Curve { fn dbl_internal(self, a: Field, d: Field) -> Self { let x1 = self.x; let y1 = self.y; - let (x3, y3, _) = __add_unconstrained(x1, x1, y1, y1, a, d); + let (x3, y3, _) = unsafe { __add_unconstrained(x1, x1, y1, y1, a, d) }; let x1x1a = x1 * x1 * a; std::as_witness(x1x1a); // t1 = a*x_1^2 + y_1^2 diff --git a/src/scalar_field.nr b/src/scalar_field.nr index 6f80bda..8adec11 100644 --- a/src/scalar_field.nr +++ b/src/scalar_field.nr @@ -83,7 +83,7 @@ impl std::convert::From for ScalarField { /// (e.g. sum of slices != x + modulus) fn from(x: Field) -> Self { let mut result: Self = ScalarField { base4_slices: [0; N], skew: false }; - let (slices, skew): ([u8; N], bool) = get_wnaf_slices(x); + let (slices, skew): ([u8; N], bool) = unsafe { get_wnaf_slices(x) }; result.base4_slices = slices; result.skew = skew; if (N < 64) {