From caddd7eb18693f5ed02cca533b84811425d8f4d8 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/crypto/pcurves/p256/scalar.zig b/lib/std/crypto/pcurves/p256/scalar.zig index 02474bae08..afdc3fb502 100644 --- a/lib/std/crypto/pcurves/p256/scalar.zig +++ b/lib/std/crypto/pcurves/p256/scalar.zig @@ -63,7 +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 { - return (try Scalar.fromBytes(a, endian)).neg().toBytes(endian); + return (try Scalar.fromBytes(s, endian)).neg().toBytes(endian); } /// Return (a-b) (mod L)