| author | |
| committer | |
| log | c60d8f017ea698c5fe4c7c6046f8ca09f0b8bf1d |
| tree | bbb3db8d212f7612bc5d81f6754f33a060b06ae2 |
| parent | 0c71d2fdc1cfa251b1c45a93724240a052c77a92 |
@g-w1's fancy new compile error in action12 files changed, 26 insertions(+), 26 deletions(-)
lib/std/crypto/25519/edwards25519.zig+2-2| ... | ... | @@ -226,12 +226,12 @@ pub const Edwards25519 = struct { |
| 226 | 226 | return pc; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | const basePointPc = comptime pc: { | |
| 229 | const basePointPc = pc: { | |
| 230 | 230 | @setEvalBranchQuota(10000); |
| 231 | 231 | break :pc precompute(Edwards25519.basePoint, 15); |
| 232 | 232 | }; |
| 233 | 233 | |
| 234 | const basePointPc8 = comptime pc: { | |
| 234 | const basePointPc8 = pc: { | |
| 235 | 235 | @setEvalBranchQuota(10000); |
| 236 | 236 | break :pc precompute(Edwards25519.basePoint, 8); |
| 237 | 237 | }; |
lib/std/crypto/25519/field.zig+1-1| ... | ... | @@ -292,7 +292,7 @@ pub const Fe = struct { |
| 292 | 292 | return _carry128(&r); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | fn _sq(a: Fe, double: comptime bool) callconv(.Inline) Fe { | |
| 295 | fn _sq(a: Fe, double: bool) callconv(.Inline) Fe { | |
| 296 | 296 | var ax: [5]u128 = undefined; |
| 297 | 297 | var r: [5]u128 = undefined; |
| 298 | 298 | comptime var i = 0; |
lib/std/crypto/aes.zig+3-3| ... | ... | @@ -8,9 +8,9 @@ const std = @import("../std.zig"); |
| 8 | 8 | const testing = std.testing; |
| 9 | 9 | const builtin = std.builtin; |
| 10 | 10 | |
| 11 | const has_aesni = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 12 | const has_avx = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); | |
| 13 | const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 11 | const has_aesni = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 12 | const has_avx = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); | |
| 13 | const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 14 | 14 | const impl = if (std.Target.current.cpu.arch == .x86_64 and has_aesni and has_avx) impl: { |
| 15 | 15 | break :impl @import("aes/aesni.zig"); |
| 16 | 16 | } else if (std.Target.current.cpu.arch == .aarch64 and has_armaes) |
lib/std/crypto/aes_ocb.zig+2-2| ... | ... | @@ -106,8 +106,8 @@ fn AesOcb(comptime Aes: anytype) type { |
| 106 | 106 | return offset; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | const has_aesni = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 110 | const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 109 | const has_aesni = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 110 | const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 111 | 111 | const wb: usize = if ((std.Target.current.cpu.arch == .x86_64 and has_aesni) or (std.Target.current.cpu.arch == .aarch64 and has_armaes)) 4 else 0; |
| 112 | 112 | |
| 113 | 113 | /// c: ciphertext: output buffer should be of size m.len |
lib/std/crypto/ghash.zig+3-3| ... | ... | @@ -137,9 +137,9 @@ pub const Ghash = struct { |
| 137 | 137 | return z0 | z1 | z2 | z3; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | const has_pclmul = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .pclmul); | |
| 141 | const has_avx = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); | |
| 142 | const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 140 | const has_pclmul = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .pclmul); | |
| 141 | const has_avx = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx); | |
| 142 | const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes); | |
| 143 | 143 | const clmul = if (std.Target.current.cpu.arch == .x86_64 and has_pclmul and has_avx) impl: { |
| 144 | 144 | break :impl clmul_pclmul; |
| 145 | 145 | } else if (std.Target.current.cpu.arch == .aarch64 and has_armaes) impl: { |
lib/std/crypto/modes.zig+1-1| ... | ... | @@ -16,7 +16,7 @@ const debug = std.debug; |
| 16 | 16 | /// |
| 17 | 17 | /// Important: the counter mode doesn't provide authenticated encryption: the ciphertext can be trivially modified without this being detected. |
| 18 | 18 | /// As a result, applications should generally never use it directly, but only in a construction that includes a MAC. |
| 19 | pub fn ctr(comptime BlockCipher: anytype, block_cipher: BlockCipher, dst: []u8, src: []const u8, iv: [BlockCipher.block_length]u8, endian: comptime builtin.Endian) void { | |
| 19 | pub fn ctr(comptime BlockCipher: anytype, block_cipher: BlockCipher, dst: []u8, src: []const u8, iv: [BlockCipher.block_length]u8, endian: builtin.Endian) void { | |
| 20 | 20 | debug.assert(dst.len >= src.len); |
| 21 | 21 | const block_length = BlockCipher.block_length; |
| 22 | 22 | var counter: [BlockCipher.block_length]u8 = undefined; |
lib/std/crypto/poly1305.zig+1-1| ... | ... | @@ -39,7 +39,7 @@ pub const Poly1305 = struct { |
| 39 | 39 | }; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | fn blocks(st: *Poly1305, m: []const u8, last: comptime bool) void { | |
| 42 | fn blocks(st: *Poly1305, m: []const u8, last: bool) void { | |
| 43 | 43 | const hibit: u64 = if (last) 0 else 1 << 40; |
| 44 | 44 | const r0 = st.r[0]; |
| 45 | 45 | const r1 = st.r[1]; |
lib/std/debug.zig+3-3| ... | ... | @@ -353,18 +353,18 @@ pub const StackIterator = struct { |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | // Offset of the saved BP wrt the frame pointer. |
| 356 | const fp_offset = if (comptime native_arch.isRISCV()) | |
| 356 | const fp_offset = if (native_arch.isRISCV()) | |
| 357 | 357 | // On RISC-V the frame pointer points to the top of the saved register |
| 358 | 358 | // area, on pretty much every other architecture it points to the stack |
| 359 | 359 | // slot where the previous frame pointer is saved. |
| 360 | 360 | 2 * @sizeOf(usize) |
| 361 | else if (comptime native_arch.isSPARC()) | |
| 361 | else if (native_arch.isSPARC()) | |
| 362 | 362 | // On SPARC the previous frame pointer is stored at 14 slots past %fp+BIAS. |
| 363 | 363 | 14 * @sizeOf(usize) |
| 364 | 364 | else |
| 365 | 365 | 0; |
| 366 | 366 | |
| 367 | const fp_bias = if (comptime native_arch.isSPARC()) | |
| 367 | const fp_bias = if (native_arch.isSPARC()) | |
| 368 | 368 | // On SPARC frame pointers are biased by a constant. |
| 369 | 369 | 2047 |
| 370 | 370 | else |
lib/std/hash/crc.zig+2-2| ... | ... | @@ -28,7 +28,7 @@ pub const Crc32 = Crc32WithPoly(.IEEE); |
| 28 | 28 | pub fn Crc32WithPoly(comptime poly: Polynomial) type { |
| 29 | 29 | return struct { |
| 30 | 30 | const Self = @This(); |
| 31 | const lookup_tables = comptime block: { | |
| 31 | const lookup_tables = block: { | |
| 32 | 32 | @setEvalBranchQuota(20000); |
| 33 | 33 | var tables: [8][256]u32 = undefined; |
| 34 | 34 | |
| ... | ... | @@ -128,7 +128,7 @@ test "crc32 castagnoli" { |
| 128 | 128 | pub fn Crc32SmallWithPoly(comptime poly: Polynomial) type { |
| 129 | 129 | return struct { |
| 130 | 130 | const Self = @This(); |
| 131 | const lookup_table = comptime block: { | |
| 131 | const lookup_table = block: { | |
| 132 | 132 | var table: [16]u32 = undefined; |
| 133 | 133 | |
| 134 | 134 | for (table) |*e, i| { |
lib/std/heap.zig+3-3| ... | ... | @@ -28,17 +28,17 @@ const CAllocator = struct { |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | usingnamespace if (comptime @hasDecl(c, "malloc_size")) | |
| 31 | usingnamespace if (@hasDecl(c, "malloc_size")) | |
| 32 | 32 | struct { |
| 33 | 33 | pub const supports_malloc_size = true; |
| 34 | 34 | pub const malloc_size = c.malloc_size; |
| 35 | 35 | } |
| 36 | else if (comptime @hasDecl(c, "malloc_usable_size")) | |
| 36 | else if (@hasDecl(c, "malloc_usable_size")) | |
| 37 | 37 | struct { |
| 38 | 38 | pub const supports_malloc_size = true; |
| 39 | 39 | pub const malloc_size = c.malloc_usable_size; |
| 40 | 40 | } |
| 41 | else if (comptime @hasDecl(c, "_msize")) | |
| 41 | else if (@hasDecl(c, "_msize")) | |
| 42 | 42 | struct { |
| 43 | 43 | pub const supports_malloc_size = true; |
| 44 | 44 | pub const malloc_size = c._msize; |
lib/std/io/bit_reader.zig+3-3| ... | ... | @@ -23,9 +23,9 @@ pub fn BitReader(endian: builtin.Endian, comptime ReaderType: type) type { |
| 23 | 23 | pub const Reader = io.Reader(*Self, Error, read); |
| 24 | 24 | |
| 25 | 25 | const Self = @This(); |
| 26 | const u8_bit_count = comptime meta.bitCount(u8); | |
| 27 | const u7_bit_count = comptime meta.bitCount(u7); | |
| 28 | const u4_bit_count = comptime meta.bitCount(u4); | |
| 26 | const u8_bit_count = meta.bitCount(u8); | |
| 27 | const u7_bit_count = meta.bitCount(u7); | |
| 28 | const u4_bit_count = meta.bitCount(u4); | |
| 29 | 29 | |
| 30 | 30 | pub fn init(forward_reader: ReaderType) Self { |
| 31 | 31 | return Self{ |
lib/std/io/bit_writer.zig+2-2| ... | ... | @@ -23,8 +23,8 @@ pub fn BitWriter(endian: builtin.Endian, comptime WriterType: type) type { |
| 23 | 23 | pub const Writer = io.Writer(*Self, Error, write); |
| 24 | 24 | |
| 25 | 25 | const Self = @This(); |
| 26 | const u8_bit_count = comptime meta.bitCount(u8); | |
| 27 | const u4_bit_count = comptime meta.bitCount(u4); | |
| 26 | const u8_bit_count = meta.bitCount(u8); | |
| 27 | const u4_bit_count = meta.bitCount(u4); | |
| 28 | 28 | |
| 29 | 29 | pub fn init(forward_writer: WriterType) Self { |
| 30 | 30 | return Self{ |