authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-07 13:50:11+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-07 13:50:11+02:00
log26fd35ff902cb0f68ada18706e7f670b4aac3d4a
tree875b467374a2c4d223751ebd9a39ed2c20aff3b2
parent9fe22a29b34e274af4f1d67a08c7757d2d0bc1fa
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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

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

1 files changed, 16 insertions(+), 0 deletions(-)

lib/std/crypto/pcurves/tests/secp256k1.zig+16
......@@ -72,6 +72,8 @@ test "secp256k1 test vectors" {
7272}
7373
7474test "secp256k1 test vectors - doubling" {
75 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
76
7577 const expected = [_][]const u8{
7678 "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
7779 "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5",
......@@ -110,6 +112,8 @@ test "secp256k1 uncompressed sec1 encoding/decoding" {
110112}
111113
112114test "secp256k1 public key is the neutral element" {
115 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
116
113117 const io = testing.io;
114118 const n = Secp256k1.scalar.Scalar.zero.toBytes(.little);
115119 const p = Secp256k1.random(io);
......@@ -126,17 +130,23 @@ test "secp256k1 public key is the neutral element (public verification)" {
126130}
127131
128132test "secp256k1 field element non-canonical encoding" {
133 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
134
129135 const s: [32]u8 = @splat(0xff);
130136 try testing.expectError(error.NonCanonical, Secp256k1.Fe.fromBytes(s, .little));
131137}
132138
133139test "secp256k1 neutral element decoding" {
140 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
141
134142 try testing.expectError(error.InvalidEncoding, Secp256k1.fromAffineCoordinates(.{ .x = Secp256k1.Fe.zero, .y = Secp256k1.Fe.zero }));
135143 try testing.expectError(error.InvalidEncoding, Secp256k1.fromAffineCoordinates(.{ .x = Secp256k1.Fe.zero, .y = Secp256k1.Fe.one }));
136144 try testing.expectError(error.IdentityElement, Secp256k1.identityElement.rejectIdentity());
137145}
138146
139147test "secp256k1 uncompressed SEC1 must not accept infinity" {
148 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
149
140150 var buf: [65]u8 = @splat(0);
141151 buf[0] = 0x04;
142152 buf[64] = 0x01;
......@@ -177,6 +187,8 @@ test "secp256k1 public multiplication" {
177187}
178188
179189test "secp256k1 scalar split" {
190 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
191
180192 const io = testing.io;
181193 const n = Secp256k1.scalar.field_order;
182194 inline for (.{ .little, .big }) |endian| {
......@@ -193,6 +205,8 @@ test "secp256k1 scalar split" {
193205}
194206
195207test "secp256k1 scalar inverse" {
208 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
209
196210 const expected = "08d0684a0fe8ea978b68a29e4b4ffdbd19eeb59db25301cf23ecbe568e1f9822";
197211 var out: [32]u8 = undefined;
198212 _ = try std.fmt.hexToBytes(&out, expected);
......@@ -206,6 +220,8 @@ test "secp256k1 scalar inverse" {
206220}
207221
208222test "secp256k1 scalar parity" {
223 if (builtin.zig_backend == .stage2_llvm and builtin.target.cpu.arch.isPowerpc64()) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/37121
224
209225 try std.testing.expect(Secp256k1.scalar.Scalar.zero.isOdd() == false);
210226 try std.testing.expect(Secp256k1.scalar.Scalar.one.isOdd());
211227 try std.testing.expect(Secp256k1.scalar.Scalar.one.dbl().isOdd() == false);