Commit caddd7eb18

Andrew Kelley <andrew@ziglang.org>
2021-06-21 21:40:27
std.crypto.p256: fix neg function compile error
There was a typo here and the neg function referenced a non-existent variable.
1 parent 2b6727c
Changed files (1)
lib
std
crypto
pcurves
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)