diff --git a/.github/workflows/zig.yml b/.github/workflows/zig.yml index 9c3e72035c..75b9807072 100644 --- a/.github/workflows/zig.yml +++ b/.github/workflows/zig.yml @@ -17,9 +17,9 @@ jobs: steps: - name: Install Zig - uses: goto-bus-stop/setup-zig@v2 + uses: mlugg/setup-zig@v1 with: - version: 0.13.0 + version: 0.14.0 - uses: actions/checkout@v4 - name: Test Zig files run: (cd fiat-zig && zig build && zig build test) diff --git a/fiat-zig/src/curve25519_32.zig b/fiat-zig/src/curve25519_32.zig index d879addeb6..9272bd78f3 100644 --- a/fiat-zig/src/curve25519_32.zig +++ b/fiat-zig/src/curve25519_32.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/curve25519_64.zig b/fiat-zig/src/curve25519_64.zig index ef86c4da01..f51b977e61 100644 --- a/fiat-zig/src/curve25519_64.zig +++ b/fiat-zig/src/curve25519_64.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/curve25519_scalar_32.zig b/fiat-zig/src/curve25519_scalar_32.zig index ba1c113548..d84d62e187 100644 --- a/fiat-zig/src/curve25519_scalar_32.zig +++ b/fiat-zig/src/curve25519_scalar_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/curve25519_scalar_64.zig b/fiat-zig/src/curve25519_scalar_64.zig index 0a3e14a8dd..112173bb12 100644 --- a/fiat-zig/src/curve25519_scalar_64.zig +++ b/fiat-zig/src/curve25519_scalar_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/curve25519_solinas_64.zig b/fiat-zig/src/curve25519_solinas_64.zig index d3b1789cd4..4146ba5485 100644 --- a/fiat-zig/src/curve25519_solinas_64.zig +++ b/fiat-zig/src/curve25519_solinas_64.zig @@ -12,9 +12,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/main.zig b/fiat-zig/src/main.zig index 04b9b1af66..937ceb7dfb 100644 --- a/fiat-zig/src/main.zig +++ b/fiat-zig/src/main.zig @@ -4,17 +4,17 @@ const fmt = std.fmt; fn testVector(comptime fiat: type, expected_s: []const u8) !void { // Find the type of the limbs and the size of the serialized representation. const repr = switch (@typeInfo(@TypeOf(fiat.fromBytes))) { - .Fn => |f| .{ + .@"fn" => |f| .{ .Limbs = switch (@typeInfo(f.params[0].type.?)) { - .Pointer => |p| p.child, + .pointer => |p| p.child, else => unreachable, }, - .Bytes = f.params[1].type.?, + .bytes = f.params[1].type.?, }, else => unreachable, }; const Limbs = repr.Limbs; - const Bytes = repr.Bytes; + const Bytes = repr.bytes; const encoded_length = @sizeOf(Bytes); // Trigger most available functions. diff --git a/fiat-zig/src/p224_32.zig b/fiat-zig/src/p224_32.zig index 640d739cf0..5ffb6435d5 100644 --- a/fiat-zig/src/p224_32.zig +++ b/fiat-zig/src/p224_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p224_64.zig b/fiat-zig/src/p224_64.zig index 6fbf854c73..7ffaeaa514 100644 --- a/fiat-zig/src/p224_64.zig +++ b/fiat-zig/src/p224_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p256_32.zig b/fiat-zig/src/p256_32.zig index 2d3928c9dd..f576137104 100644 --- a/fiat-zig/src/p256_32.zig +++ b/fiat-zig/src/p256_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p256_64.zig b/fiat-zig/src/p256_64.zig index 17d59a54d2..068f93abef 100644 --- a/fiat-zig/src/p256_64.zig +++ b/fiat-zig/src/p256_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p256_scalar_32.zig b/fiat-zig/src/p256_scalar_32.zig index b4d6ff2727..5772769148 100644 --- a/fiat-zig/src/p256_scalar_32.zig +++ b/fiat-zig/src/p256_scalar_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p256_scalar_64.zig b/fiat-zig/src/p256_scalar_64.zig index 4c670e1b40..a686924aaa 100644 --- a/fiat-zig/src/p256_scalar_64.zig +++ b/fiat-zig/src/p256_scalar_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p384_32.zig b/fiat-zig/src/p384_32.zig index e3c9bf9783..b9abc4db2c 100644 --- a/fiat-zig/src/p384_32.zig +++ b/fiat-zig/src/p384_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p384_64.zig b/fiat-zig/src/p384_64.zig index e3fa1cfe4a..98a0869302 100644 --- a/fiat-zig/src/p384_64.zig +++ b/fiat-zig/src/p384_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p384_scalar_32.zig b/fiat-zig/src/p384_scalar_32.zig index e17883edb1..a90a38869d 100644 --- a/fiat-zig/src/p384_scalar_32.zig +++ b/fiat-zig/src/p384_scalar_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p384_scalar_64.zig b/fiat-zig/src/p384_scalar_64.zig index 957028d6e9..7340344655 100644 --- a/fiat-zig/src/p384_scalar_64.zig +++ b/fiat-zig/src/p384_scalar_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p434_64.zig b/fiat-zig/src/p434_64.zig index 0be723d5e3..ca5968ae08 100644 --- a/fiat-zig/src/p434_64.zig +++ b/fiat-zig/src/p434_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p448_solinas_32.zig b/fiat-zig/src/p448_solinas_32.zig index fd75bbeacd..9dc0a221ae 100644 --- a/fiat-zig/src/p448_solinas_32.zig +++ b/fiat-zig/src/p448_solinas_32.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p448_solinas_64.zig b/fiat-zig/src/p448_solinas_64.zig index 921adae629..d36a9a90a6 100644 --- a/fiat-zig/src/p448_solinas_64.zig +++ b/fiat-zig/src/p448_solinas_64.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p521_32.zig b/fiat-zig/src/p521_32.zig index a7cff39e37..8cdde47e62 100644 --- a/fiat-zig/src/p521_32.zig +++ b/fiat-zig/src/p521_32.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/p521_64.zig b/fiat-zig/src/p521_64.zig index 5fd41d6378..ac067f0179 100644 --- a/fiat-zig/src/p521_64.zig +++ b/fiat-zig/src/p521_64.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/poly1305_32.zig b/fiat-zig/src/poly1305_32.zig index 708df9e03a..4ef79a2ac5 100644 --- a/fiat-zig/src/poly1305_32.zig +++ b/fiat-zig/src/poly1305_32.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/poly1305_64.zig b/fiat-zig/src/poly1305_64.zig index fd058b74b8..ea4abc9978 100644 --- a/fiat-zig/src/poly1305_64.zig +++ b/fiat-zig/src/poly1305_64.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/secp256k1_dettman_32.zig b/fiat-zig/src/secp256k1_dettman_32.zig index 8668e81be0..3f7c8eac54 100644 --- a/fiat-zig/src/secp256k1_dettman_32.zig +++ b/fiat-zig/src/secp256k1_dettman_32.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/secp256k1_dettman_64.zig b/fiat-zig/src/secp256k1_dettman_64.zig index bf35ca3190..8516a8c689 100644 --- a/fiat-zig/src/secp256k1_dettman_64.zig +++ b/fiat-zig/src/secp256k1_dettman_64.zig @@ -17,9 +17,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/secp256k1_montgomery_32.zig b/fiat-zig/src/secp256k1_montgomery_32.zig index 81c085d64f..a2494d4e37 100644 --- a/fiat-zig/src/secp256k1_montgomery_32.zig +++ b/fiat-zig/src/secp256k1_montgomery_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/secp256k1_montgomery_64.zig b/fiat-zig/src/secp256k1_montgomery_64.zig index b2e8e4f6e9..8e54e092d4 100644 --- a/fiat-zig/src/secp256k1_montgomery_64.zig +++ b/fiat-zig/src/secp256k1_montgomery_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/secp256k1_montgomery_scalar_32.zig b/fiat-zig/src/secp256k1_montgomery_scalar_32.zig index 2ec9224422..5d630f66dc 100644 --- a/fiat-zig/src/secp256k1_montgomery_scalar_32.zig +++ b/fiat-zig/src/secp256k1_montgomery_scalar_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/secp256k1_montgomery_scalar_64.zig b/fiat-zig/src/secp256k1_montgomery_scalar_64.zig index 05870587ca..348dd4b6cc 100644 --- a/fiat-zig/src/secp256k1_montgomery_scalar_64.zig +++ b/fiat-zig/src/secp256k1_montgomery_scalar_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/sm2_32.zig b/fiat-zig/src/sm2_32.zig index ffe5959f8f..a358f250c6 100644 --- a/fiat-zig/src/sm2_32.zig +++ b/fiat-zig/src/sm2_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/sm2_64.zig b/fiat-zig/src/sm2_64.zig index d5662ba937..d83b755910 100644 --- a/fiat-zig/src/sm2_64.zig +++ b/fiat-zig/src/sm2_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/sm2_scalar_32.zig b/fiat-zig/src/sm2_scalar_32.zig index 8bb81bbab2..df8d6244be 100644 --- a/fiat-zig/src/sm2_scalar_32.zig +++ b/fiat-zig/src/sm2_scalar_32.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/fiat-zig/src/sm2_scalar_64.zig b/fiat-zig/src/sm2_scalar_64.zig index c2901d86fd..d70c11777f 100644 --- a/fiat-zig/src/sm2_scalar_64.zig +++ b/fiat-zig/src/sm2_scalar_64.zig @@ -22,9 +22,9 @@ const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-d inline fn cast(comptime DestType: type, target: anytype) DestType { @setEvalBranchQuota(10000); - if (@typeInfo(@TypeOf(target)) == .Int) { - const dest = @typeInfo(DestType).Int; - const source = @typeInfo(@TypeOf(target)).Int; + if (@typeInfo(@TypeOf(target)) == .int) { + const dest = @typeInfo(DestType).int; + const source = @typeInfo(@TypeOf(target)).int; if (dest.bits < source.bits) { const T = std.meta.Int(source.signedness, dest.bits); return @bitCast(@as(T, @truncate(target))); diff --git a/src/Stringification/Zig.v b/src/Stringification/Zig.v index 94641dff62..690bafb6a3 100644 --- a/src/Stringification/Zig.v +++ b/src/Stringification/Zig.v @@ -101,9 +101,9 @@ Module Zig. ""; "inline fn cast(comptime DestType: type, target: anytype) DestType {"; " @setEvalBranchQuota(10000);"; - " if (@typeInfo(@TypeOf(target)) == .Int) {"; - " const dest = @typeInfo(DestType).Int;"; - " const source = @typeInfo(@TypeOf(target)).Int;"; + " if (@typeInfo(@TypeOf(target)) == .int) {"; + " const dest = @typeInfo(DestType).int;"; + " const source = @typeInfo(@TypeOf(target)).int;"; " if (dest.bits < source.bits) {"; " const T = std.meta.Int(source.signedness, dest.bits);"; " return @bitCast(@as(T, @truncate(target)));";