authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-07 03:56:17+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-07 06:15:17+02:00
log5938e94196afe7551b3741a2b7121420a162f2a1
tree77177eb9e695a89390235e8298825f7f0a1ee74f
parent57c0a8c9b4eb13b4633842f0cee499243ab2d0e0
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.crypto: disable secp256k1 tests affected by an llvm 23 powerpc regression

https://codeberg.org/ziglang/zig/issues/37121

2 files changed, 22 insertions(+), 0 deletions(-)

lib/std/crypto/ecdsa.zig+3
......@@ -1,3 +1,4 @@
1const builtin = @import("builtin");
12const std = @import("std");
23const crypto = std.crypto;
34const fmt = std.fmt;
......@@ -439,6 +440,8 @@ test "Basic operations over EcdsaP384Sha384" {
439440}
440441
441442test "Basic operations over Secp256k1" {
443 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
444
442445 const io = testing.io;
443446 const Scheme = EcdsaSecp256k1Sha256oSha256;
444447 const kp = Scheme.KeyPair.generate(io);
lib/std/crypto/pcurves/tests/secp256k1.zig+19
......@@ -1,3 +1,4 @@
1const builtin = @import("builtin");
12const std = @import("std");
23const fmt = std.fmt;
34const testing = std.testing;
......@@ -7,6 +8,8 @@ const Secp256k1 = @import("../secp256k1.zig").Secp256k1;
78const lambda: u256 = 0x5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72;
89
910test "secp256k1 ECDH key exchange" {
11 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
12
1013 const io = testing.io;
1114 const dha = Secp256k1.scalar.random(io, .little);
1215 const dhb = Secp256k1.scalar.random(io, .little);
......@@ -18,6 +21,8 @@ test "secp256k1 ECDH key exchange" {
1821}
1922
2023test "secp256k1 ECDH key exchange including public multiplication" {
24 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
25
2126 const io = testing.io;
2227 const dha = Secp256k1.scalar.random(io, .little);
2328 const dhb = Secp256k1.scalar.random(io, .little);
......@@ -29,6 +34,8 @@ test "secp256k1 ECDH key exchange including public multiplication" {
2934}
3035
3136test "secp256k1 point from affine coordinates" {
37 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
38
3239 const xh = "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798";
3340 const yh = "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8";
3441 var xs: [32]u8 = undefined;
......@@ -40,6 +47,8 @@ test "secp256k1 point from affine coordinates" {
4047}
4148
4249test "secp256k1 test vectors" {
50 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
51
4352 const expected = [_][]const u8{
4453 "0000000000000000000000000000000000000000000000000000000000000000",
4554 "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
......@@ -81,6 +90,8 @@ test "secp256k1 test vectors - doubling" {
8190}
8291
8392test "secp256k1 compressed sec1 encoding/decoding" {
93 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
94
8495 const io = testing.io;
8596 const p = Secp256k1.random(io);
8697 const s = p.toCompressedSec1();
......@@ -89,6 +100,8 @@ test "secp256k1 compressed sec1 encoding/decoding" {
89100}
90101
91102test "secp256k1 uncompressed sec1 encoding/decoding" {
103 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
104
92105 const io = testing.io;
93106 const p = Secp256k1.random(io);
94107 const s = p.toUncompressedSec1();
......@@ -104,6 +117,8 @@ test "secp256k1 public key is the neutral element" {
104117}
105118
106119test "secp256k1 public key is the neutral element (public verification)" {
120 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
121
107122 const io = testing.io;
108123 const n = Secp256k1.scalar.Scalar.zero.toBytes(.little);
109124 const p = Secp256k1.random(io);
......@@ -131,6 +146,8 @@ test "secp256k1 uncompressed SEC1 must not accept infinity" {
131146}
132147
133148test "secp256k1 double base multiplication" {
149 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
150
134151 const p1 = Secp256k1.basePoint;
135152 const p2 = Secp256k1.basePoint.dbl();
136153 const s1: [32]u8 = @splat(0x01);
......@@ -141,6 +158,8 @@ test "secp256k1 double base multiplication" {
141158}
142159
143160test "secp256k1 public multiplication" {
161 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
162
144163 const io = testing.io;
145164 const n = Secp256k1.scalar.field_order;
146165 const p = Secp256k1.random(io);