From 98b10d94bf88a7e07690663008eb3f3dc8bfceca Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 21 Jun 2021 12:40:27 -0700 Subject: [PATCH] std.crypto.p256: fix neg function compile error There was a typo here and the neg function referenced a non-existent variable. --- lib/std/crypto/pcurves/p256/scalar.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/std/crypto/pcurves/p256/scalar.zig b/lib/std/crypto/pcurves/p256/scalar.zig index 7a5eded2d6..afdc3fb502 100644 --- a/lib/std/crypto/pcurves/p256/scalar.zig +++ b/lib/std/crypto/pcurves/p256/scalar.zig @@ -63,8 +63,7 @@ pub fn add(a: CompressedScalar, b: CompressedScalar, endian: builtin.Endian) Non /// Return -s (mod L) pub fn neg(s: CompressedScalar, endian: builtin.Endian) NonCanonicalError!CompressedScalar { - _ = s; - return (try Scalar.fromBytes(a, endian)).neg().toBytes(endian); + return (try Scalar.fromBytes(s, endian)).neg().toBytes(endian); } /// Return (a-b) (mod L)