| author | |
| committer | |
| log | 6ad22cd964741ec646eb551877591d719e0c41f5 |
| tree | 3101238c5e330ba642a0f4625cf4862870533d02 |
| parent | 48526c0eb6c394b778cba11559a66daf8d5ec3c7 |
17 files changed, 36 insertions(+), 97 deletions(-)
lib/std/compress/deflate/compressor.zig-2| ... | ... | @@ -1069,8 +1069,6 @@ var deflate_tests = [_]DeflateTest{ |
| 1069 | 1069 | }; |
| 1070 | 1070 | |
| 1071 | 1071 | test "deflate" { |
| 1072 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1073 | ||
| 1074 | 1072 | for (deflate_tests) |dt| { |
| 1075 | 1073 | var output = ArrayList(u8).init(testing.allocator); |
| 1076 | 1074 | defer output.deinit(); |
lib/std/compress/deflate/compressor_test.zig+1-18| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 3 | 2 | const expect = std.testing.expect; |
| 4 | 3 | const fifo = std.fifo; |
| 5 | 4 | const io = std.io; |
| ... | ... | @@ -154,8 +153,6 @@ fn testToFromWithLimit(input: []const u8, limit: [11]u32) !void { |
| 154 | 153 | } |
| 155 | 154 | |
| 156 | 155 | test "deflate/inflate" { |
| 157 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 158 | ||
| 159 | 156 | var limits = [_]u32{0} ** 11; |
| 160 | 157 | |
| 161 | 158 | var test0 = [_]u8{}; |
| ... | ... | @@ -180,8 +177,6 @@ test "deflate/inflate" { |
| 180 | 177 | } |
| 181 | 178 | |
| 182 | 179 | test "very long sparse chunk" { |
| 183 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 184 | ||
| 185 | 180 | // A SparseReader returns a stream consisting of 0s ending with 65,536 (1<<16) 1s. |
| 186 | 181 | // This tests missing hash references in a very large input. |
| 187 | 182 | const SparseReader = struct { |
| ... | ... | @@ -243,7 +238,7 @@ test "very long sparse chunk" { |
| 243 | 238 | } |
| 244 | 239 | |
| 245 | 240 | test "compressor reset" { |
| 246 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 241 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 247 | 242 | |
| 248 | 243 | for (std.enums.values(deflate.Compression)) |c| { |
| 249 | 244 | try testWriterReset(c, null); |
| ... | ... | @@ -295,8 +290,6 @@ fn testWriterReset(level: deflate.Compression, dict: ?[]const u8) !void { |
| 295 | 290 | } |
| 296 | 291 | |
| 297 | 292 | test "decompressor dictionary" { |
| 298 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 299 | ||
| 300 | 293 | const dict = "hello world"; // dictionary |
| 301 | 294 | const text = "hello again world"; |
| 302 | 295 | |
| ... | ... | @@ -337,8 +330,6 @@ test "decompressor dictionary" { |
| 337 | 330 | } |
| 338 | 331 | |
| 339 | 332 | test "compressor dictionary" { |
| 340 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 341 | ||
| 342 | 333 | const dict = "hello world"; |
| 343 | 334 | const text = "hello again world"; |
| 344 | 335 | |
| ... | ... | @@ -385,8 +376,6 @@ test "compressor dictionary" { |
| 385 | 376 | // Update the hash for best_speed only if d.index < d.maxInsertIndex |
| 386 | 377 | // See https://golang.org/issue/2508 |
| 387 | 378 | test "Go non-regression test for 2508" { |
| 388 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 389 | ||
| 390 | 379 | var comp = try compressor( |
| 391 | 380 | testing.allocator, |
| 392 | 381 | io.null_writer, |
| ... | ... | @@ -404,8 +393,6 @@ test "Go non-regression test for 2508" { |
| 404 | 393 | } |
| 405 | 394 | |
| 406 | 395 | test "deflate/inflate string" { |
| 407 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 408 | ||
| 409 | 396 | const StringTest = struct { |
| 410 | 397 | filename: []const u8, |
| 411 | 398 | limit: [11]u32, |
| ... | ... | @@ -453,8 +440,6 @@ test "deflate/inflate string" { |
| 453 | 440 | } |
| 454 | 441 | |
| 455 | 442 | test "inflate reset" { |
| 456 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 457 | ||
| 458 | 443 | const strings = [_][]const u8{ |
| 459 | 444 | "lorem ipsum izzle fo rizzle", |
| 460 | 445 | "the quick brown fox jumped over", |
| ... | ... | @@ -501,8 +486,6 @@ test "inflate reset" { |
| 501 | 486 | } |
| 502 | 487 | |
| 503 | 488 | test "inflate reset dictionary" { |
| 504 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 505 | ||
| 506 | 489 | const dict = "the lorem fox"; |
| 507 | 490 | const strings = [_][]const u8{ |
| 508 | 491 | "lorem ipsum izzle fo rizzle", |
lib/std/compress/deflate/deflate_fast.zig-2| ... | ... | @@ -649,8 +649,6 @@ test "best speed shift offsets" { |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | test "best speed reset" { |
| 652 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 653 | ||
| 654 | 652 | // test that encoding is consistent across a warparound of the table offset. |
| 655 | 653 | // See https://github.com/golang/go/issues/34121 |
| 656 | 654 | const fmt = std.fmt; |
lib/std/compress/deflate/deflate_fast_test.zig-5| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 3 | 2 | const expect = std.testing.expect; |
| 4 | 3 | const io = std.io; |
| 5 | 4 | const mem = std.mem; |
| ... | ... | @@ -12,8 +11,6 @@ const inflate = @import("decompressor.zig"); |
| 12 | 11 | const deflate_const = @import("deflate_const.zig"); |
| 13 | 12 | |
| 14 | 13 | test "best speed" { |
| 15 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 16 | ||
| 17 | 14 | // Tests that round-tripping through deflate and then inflate recovers the original input. |
| 18 | 15 | // The Write sizes are near the thresholds in the compressor.encSpeed method (0, 16, 128), as well |
| 19 | 16 | // as near `deflate_const.max_store_block_size` (65535). |
| ... | ... | @@ -96,8 +93,6 @@ test "best speed" { |
| 96 | 93 | } |
| 97 | 94 | |
| 98 | 95 | test "best speed max match offset" { |
| 99 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 100 | ||
| 101 | 96 | const abc = "abcdefgh"; |
| 102 | 97 | const xyz = "stuvwxyz"; |
| 103 | 98 | const input_margin = 16 - 1; |
lib/std/compress/deflate/huffman_bit_writer.zig-7| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | |
| 3 | 2 | const io = std.io; |
| 4 | 3 | |
| 5 | 4 | const Allocator = std.mem.Allocator; |
| ... | ... | @@ -845,8 +844,6 @@ const testing = std.testing; |
| 845 | 844 | const ArrayList = std.ArrayList; |
| 846 | 845 | |
| 847 | 846 | test "writeBlockHuff" { |
| 848 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 849 | ||
| 850 | 847 | // Tests huffman encoding against reference files to detect possible regressions. |
| 851 | 848 | // If encoding/bit allocation changes you can regenerate these files |
| 852 | 849 | |
| ... | ... | @@ -1571,8 +1568,6 @@ const TestType = enum { |
| 1571 | 1568 | }; |
| 1572 | 1569 | |
| 1573 | 1570 | test "writeBlock" { |
| 1574 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1575 | ||
| 1576 | 1571 | // tests if the writeBlock encoding has changed. |
| 1577 | 1572 | |
| 1578 | 1573 | const ttype: TestType = .write_block; |
| ... | ... | @@ -1588,8 +1583,6 @@ test "writeBlock" { |
| 1588 | 1583 | } |
| 1589 | 1584 | |
| 1590 | 1585 | test "writeBlockDynamic" { |
| 1591 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1592 | ||
| 1593 | 1586 | // tests if the writeBlockDynamic encoding has changed. |
| 1594 | 1587 | |
| 1595 | 1588 | const ttype: TestType = .write_dyn_block; |
lib/std/compress/zlib.zig-2| ... | ... | @@ -264,8 +264,6 @@ test "sanity checks" { |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | test "compress data" { |
| 267 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 268 | ||
| 269 | 267 | const allocator = testing.allocator; |
| 270 | 268 | const rfc1951_txt = @embedFile("testdata/rfc1951.txt"); |
| 271 | 269 |
lib/std/crypto/25519/ed25519.zig+2-1| ... | ... | @@ -685,7 +685,8 @@ test "ed25519 signatures with streaming" { |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | test "ed25519 key pair from secret key" { |
| 688 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 688 | if (builtin.zig_backend == .stage2_x86_64 and | |
| 689 | !comptime std.Target.x86.featureSetHas(builtin.cpu.features, .avx)) return error.SkipZigTest; | |
| 689 | 690 | |
| 690 | 691 | const kp = try Ed25519.KeyPair.create(null); |
| 691 | 692 | const kp2 = try Ed25519.KeyPair.fromSecretKey(kp.secret_key); |
lib/std/crypto/chacha20.zig-6| ... | ... | @@ -1029,8 +1029,6 @@ test "crypto.chacha20 test vector 5" { |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | test "seal" { |
| 1032 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1033 | ||
| 1034 | 1032 | { |
| 1035 | 1033 | const m = ""; |
| 1036 | 1034 | const ad = ""; |
| ... | ... | @@ -1081,8 +1079,6 @@ test "seal" { |
| 1081 | 1079 | } |
| 1082 | 1080 | |
| 1083 | 1081 | test "open" { |
| 1084 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1085 | ||
| 1086 | 1082 | { |
| 1087 | 1083 | const c = [_]u8{ 0xa0, 0x78, 0x4d, 0x7a, 0x47, 0x16, 0xf3, 0xfe, 0xb4, 0xf6, 0x4e, 0x7f, 0x4b, 0x39, 0xbf, 0x4 }; |
| 1088 | 1084 | const ad = ""; |
| ... | ... | @@ -1147,8 +1143,6 @@ test "open" { |
| 1147 | 1143 | } |
| 1148 | 1144 | |
| 1149 | 1145 | test "crypto.xchacha20" { |
| 1150 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 1151 | ||
| 1152 | 1146 | const key = [_]u8{69} ** 32; |
| 1153 | 1147 | const nonce = [_]u8{42} ** 24; |
| 1154 | 1148 | const m = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."; |
lib/std/crypto/ecdsa.zig+12-24| ... | ... | @@ -372,10 +372,8 @@ pub fn Ecdsa(comptime Curve: type, comptime Hash: type) type { |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | test "ECDSA - Basic operations over EcdsaP384Sha384" { |
| 375 | switch (builtin.zig_backend) { | |
| 376 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 377 | else => {}, | |
| 378 | } | |
| 375 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 376 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 379 | 377 | |
| 380 | 378 | const Scheme = EcdsaP384Sha384; |
| 381 | 379 | const kp = try Scheme.KeyPair.create(null); |
| ... | ... | @@ -391,10 +389,8 @@ test "ECDSA - Basic operations over EcdsaP384Sha384" { |
| 391 | 389 | } |
| 392 | 390 | |
| 393 | 391 | test "ECDSA - Basic operations over Secp256k1" { |
| 394 | switch (builtin.zig_backend) { | |
| 395 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 396 | else => {}, | |
| 397 | } | |
| 392 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 393 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 398 | 394 | |
| 399 | 395 | const Scheme = EcdsaSecp256k1Sha256oSha256; |
| 400 | 396 | const kp = try Scheme.KeyPair.create(null); |
| ... | ... | @@ -410,10 +406,8 @@ test "ECDSA - Basic operations over Secp256k1" { |
| 410 | 406 | } |
| 411 | 407 | |
| 412 | 408 | test "ECDSA - Basic operations over EcdsaP384Sha256" { |
| 413 | switch (builtin.zig_backend) { | |
| 414 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 415 | else => {}, | |
| 416 | } | |
| 409 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 410 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 417 | 411 | |
| 418 | 412 | const Scheme = Ecdsa(crypto.ecc.P384, crypto.hash.sha2.Sha256); |
| 419 | 413 | const kp = try Scheme.KeyPair.create(null); |
| ... | ... | @@ -429,10 +423,8 @@ test "ECDSA - Basic operations over EcdsaP384Sha256" { |
| 429 | 423 | } |
| 430 | 424 | |
| 431 | 425 | test "ECDSA - Verifying a existing signature with EcdsaP384Sha256" { |
| 432 | switch (builtin.zig_backend) { | |
| 433 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 434 | else => {}, | |
| 435 | } | |
| 426 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 427 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 436 | 428 | |
| 437 | 429 | const Scheme = Ecdsa(crypto.ecc.P384, crypto.hash.sha2.Sha256); |
| 438 | 430 | // zig fmt: off |
| ... | ... | @@ -476,10 +468,8 @@ const TestVector = struct { |
| 476 | 468 | }; |
| 477 | 469 | |
| 478 | 470 | test "ECDSA - Test vectors from Project Wycheproof" { |
| 479 | switch (builtin.zig_backend) { | |
| 480 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 481 | else => {}, | |
| 482 | } | |
| 471 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 472 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 483 | 473 | |
| 484 | 474 | const vectors = [_]TestVector{ |
| 485 | 475 | .{ .key = "042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", .msg = "313233343030", .sig = "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802204cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", .result = .valid }, |
| ... | ... | @@ -893,10 +883,8 @@ fn tvTry(vector: TestVector) !void { |
| 893 | 883 | } |
| 894 | 884 | |
| 895 | 885 | test "ECDSA - Sec1 encoding/decoding" { |
| 896 | switch (builtin.zig_backend) { | |
| 897 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 898 | else => {}, | |
| 899 | } | |
| 886 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 887 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 900 | 888 | |
| 901 | 889 | const Scheme = EcdsaP384Sha384; |
| 902 | 890 | const kp = try Scheme.KeyPair.create(null); |
lib/std/crypto/ff.zig+14-15| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | //! Parts of that code was ported from the BSD-licensed crypto/internal/bigmod/nat.go file in the Go language, itself inspired from BearSSL. |
| 7 | 7 | |
| 8 | 8 | const std = @import("std"); |
| 9 | const builtin = std.builtin; | |
| 9 | const builtin = @import("builtin"); | |
| 10 | 10 | const crypto = std.crypto; |
| 11 | 11 | const math = std.math; |
| 12 | 12 | const mem = std.mem; |
| ... | ... | @@ -14,6 +14,7 @@ const meta = std.meta; |
| 14 | 14 | const testing = std.testing; |
| 15 | 15 | const BoundedArray = std.BoundedArray; |
| 16 | 16 | const assert = std.debug.assert; |
| 17 | const Endian = std.builtin.Endian; | |
| 17 | 18 | |
| 18 | 19 | // A Limb is a single digit in a big integer. |
| 19 | 20 | const Limb = usize; |
| ... | ... | @@ -27,7 +28,7 @@ const t_bits: usize = @bitSizeOf(Limb) - carry_bits; |
| 27 | 28 | // A TLimb is a Limb that is truncated to t_bits. |
| 28 | 29 | const TLimb = meta.Int(.unsigned, t_bits); |
| 29 | 30 | |
| 30 | const native_endian = @import("builtin").target.cpu.arch.endian(); | |
| 31 | const native_endian = builtin.target.cpu.arch.endian(); | |
| 31 | 32 | |
| 32 | 33 | // A WideLimb is a Limb that is twice as wide as a normal Limb. |
| 33 | 34 | const WideLimb = struct { |
| ... | ... | @@ -128,7 +129,7 @@ pub fn Uint(comptime max_bits: comptime_int) type { |
| 128 | 129 | } |
| 129 | 130 | |
| 130 | 131 | /// Encodes a big integer into a byte array. |
| 131 | pub fn toBytes(self: Self, bytes: []u8, comptime endian: builtin.Endian) OverflowError!void { | |
| 132 | pub fn toBytes(self: Self, bytes: []u8, comptime endian: Endian) OverflowError!void { | |
| 132 | 133 | if (bytes.len == 0) { |
| 133 | 134 | if (self.isZero()) return; |
| 134 | 135 | return error.Overflow; |
| ... | ... | @@ -175,7 +176,7 @@ pub fn Uint(comptime max_bits: comptime_int) type { |
| 175 | 176 | } |
| 176 | 177 | |
| 177 | 178 | /// Creates a new big integer from a byte array. |
| 178 | pub fn fromBytes(bytes: []const u8, comptime endian: builtin.Endian) OverflowError!Self { | |
| 179 | pub fn fromBytes(bytes: []const u8, comptime endian: Endian) OverflowError!Self { | |
| 179 | 180 | if (bytes.len == 0) return Self.zero; |
| 180 | 181 | var shift: usize = 0; |
| 181 | 182 | var out = Self.zero; |
| ... | ... | @@ -335,7 +336,7 @@ fn Fe_(comptime bits: comptime_int) type { |
| 335 | 336 | } |
| 336 | 337 | |
| 337 | 338 | /// Creates a field element from a byte string. |
| 338 | pub fn fromBytes(m: Modulus(bits), bytes: []const u8, comptime endian: builtin.Endian) (OverflowError || FieldElementError)!Self { | |
| 339 | pub fn fromBytes(m: Modulus(bits), bytes: []const u8, comptime endian: Endian) (OverflowError || FieldElementError)!Self { | |
| 339 | 340 | const v = try FeUint.fromBytes(bytes, endian); |
| 340 | 341 | var fe = Self{ .v = v }; |
| 341 | 342 | try m.shrink(&fe); |
| ... | ... | @@ -344,7 +345,7 @@ fn Fe_(comptime bits: comptime_int) type { |
| 344 | 345 | } |
| 345 | 346 | |
| 346 | 347 | /// Converts the field element to a byte string. |
| 347 | pub fn toBytes(self: Self, bytes: []u8, comptime endian: builtin.Endian) OverflowError!void { | |
| 348 | pub fn toBytes(self: Self, bytes: []u8, comptime endian: Endian) OverflowError!void { | |
| 348 | 349 | return self.v.toBytes(bytes, endian); |
| 349 | 350 | } |
| 350 | 351 | |
| ... | ... | @@ -458,13 +459,13 @@ pub fn Modulus(comptime max_bits: comptime_int) type { |
| 458 | 459 | } |
| 459 | 460 | |
| 460 | 461 | /// Creates a new modulus from a byte string. |
| 461 | pub fn fromBytes(bytes: []const u8, comptime endian: builtin.Endian) (InvalidModulusError || OverflowError)!Self { | |
| 462 | pub fn fromBytes(bytes: []const u8, comptime endian: Endian) (InvalidModulusError || OverflowError)!Self { | |
| 462 | 463 | const v = try FeUint.fromBytes(bytes, endian); |
| 463 | 464 | return try Self.fromUint(v); |
| 464 | 465 | } |
| 465 | 466 | |
| 466 | 467 | /// Serializes the modulus to a byte string. |
| 467 | pub fn toBytes(self: Self, bytes: []u8, comptime endian: builtin.Endian) OverflowError!void { | |
| 468 | pub fn toBytes(self: Self, bytes: []u8, comptime endian: Endian) OverflowError!void { | |
| 468 | 469 | return self.v.toBytes(bytes, endian); |
| 469 | 470 | } |
| 470 | 471 | |
| ... | ... | @@ -658,7 +659,7 @@ pub fn Modulus(comptime max_bits: comptime_int) type { |
| 658 | 659 | |
| 659 | 660 | // Returns x^e (mod m), with the exponent provided as a byte string. |
| 660 | 661 | // `public` must be set to `false` if the exponent it secret. |
| 661 | fn powWithEncodedExponentInternal(self: Self, x: Fe, e: []const u8, endian: builtin.Endian, comptime public: bool) NullExponentError!Fe { | |
| 662 | fn powWithEncodedExponentInternal(self: Self, x: Fe, e: []const u8, endian: Endian, comptime public: bool) NullExponentError!Fe { | |
| 662 | 663 | var acc: u8 = 0; |
| 663 | 664 | for (e) |b| acc |= b; |
| 664 | 665 | if (acc == 0) return error.NullExponent; |
| ... | ... | @@ -801,7 +802,7 @@ pub fn Modulus(comptime max_bits: comptime_int) type { |
| 801 | 802 | /// doesn't have to be created if a serialized representation is already available. |
| 802 | 803 | /// |
| 803 | 804 | /// If the exponent is public, `powWithEncodedPublicExponent()` can be used instead for a slight speedup. |
| 804 | pub fn powWithEncodedExponent(self: Self, x: Fe, e: []const u8, endian: builtin.Endian) NullExponentError!Fe { | |
| 805 | pub fn powWithEncodedExponent(self: Self, x: Fe, e: []const u8, endian: Endian) NullExponentError!Fe { | |
| 805 | 806 | return self.powWithEncodedExponentInternal(x, e, endian, false); |
| 806 | 807 | } |
| 807 | 808 | |
| ... | ... | @@ -810,7 +811,7 @@ pub fn Modulus(comptime max_bits: comptime_int) type { |
| 810 | 811 | /// doesn't have to be created if a serialized representation is already available. |
| 811 | 812 | /// |
| 812 | 813 | /// If the exponent is secret, `powWithEncodedExponent` must be used instead. |
| 813 | pub fn powWithEncodedPublicExponent(self: Self, x: Fe, e: []const u8, endian: builtin.Endian) NullExponentError!Fe { | |
| 814 | pub fn powWithEncodedPublicExponent(self: Self, x: Fe, e: []const u8, endian: Endian) NullExponentError!Fe { | |
| 814 | 815 | return self.powWithEncodedExponentInternal(x, e, endian, true); |
| 815 | 816 | } |
| 816 | 817 | }; |
| ... | ... | @@ -912,10 +913,8 @@ const ct_unprotected = struct { |
| 912 | 913 | }; |
| 913 | 914 | |
| 914 | 915 | test { |
| 915 | switch (@import("builtin").zig_backend) { | |
| 916 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 917 | else => {}, | |
| 918 | } | |
| 916 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; | |
| 917 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 919 | 918 | |
| 920 | 919 | const M = Modulus(256); |
| 921 | 920 | const m = try M.fromPrimitive(u256, 3429938563481314093726330772853735541133072814650493833233); |
lib/std/crypto/pcurves/p384.zig+2-4| ... | ... | @@ -478,10 +478,8 @@ pub const AffineCoordinates = struct { |
| 478 | 478 | }; |
| 479 | 479 | |
| 480 | 480 | test { |
| 481 | switch (@import("builtin").zig_backend) { | |
| 482 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 483 | else => {}, | |
| 484 | } | |
| 481 | if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest; | |
| 482 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 485 | 483 | |
| 486 | 484 | _ = @import("tests/p384.zig"); |
| 487 | 485 | } |
lib/std/crypto/pcurves/secp256k1.zig+2-4| ... | ... | @@ -556,10 +556,8 @@ pub const AffineCoordinates = struct { |
| 556 | 556 | }; |
| 557 | 557 | |
| 558 | 558 | test { |
| 559 | switch (@import("builtin").zig_backend) { | |
| 560 | .stage2_c, .stage2_x86_64 => return error.SkipZigTest, | |
| 561 | else => {}, | |
| 562 | } | |
| 559 | if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest; | |
| 560 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 563 | 561 | |
| 564 | 562 | _ = @import("tests/secp256k1.zig"); |
| 565 | 563 | } |
lib/std/crypto/poly1305.zig-2| ... | ... | @@ -196,8 +196,6 @@ pub const Poly1305 = struct { |
| 196 | 196 | }; |
| 197 | 197 | |
| 198 | 198 | test "poly1305 rfc7439 vector1" { |
| 199 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 200 | ||
| 201 | 199 | const expected_mac = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9"; |
| 202 | 200 | |
| 203 | 201 | const msg = "Cryptographic Forum Research Group"; |
lib/std/crypto/salsa20.zig-2| ... | ... | @@ -623,8 +623,6 @@ test "xsalsa20poly1305 sealedbox" { |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | test "secretbox twoblocks" { |
| 626 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 627 | ||
| 628 | 626 | const key = [_]u8{ 0xc9, 0xc9, 0x4d, 0xcf, 0x68, 0xbe, 0x00, 0xe4, 0x7f, 0xe6, 0x13, 0x26, 0xfc, 0xc4, 0x2f, 0xd0, 0xdb, 0x93, 0x91, 0x1c, 0x09, 0x94, 0x89, 0xe1, 0x1b, 0x88, 0x63, 0x18, 0x86, 0x64, 0x8b, 0x7b }; |
| 629 | 627 | const nonce = [_]u8{ 0xa4, 0x33, 0xe9, 0x0a, 0x07, 0x68, 0x6e, 0x9a, 0x2b, 0x6d, 0xd4, 0x59, 0x04, 0x72, 0x3e, 0xd3, 0x8a, 0x67, 0x55, 0xc7, 0x9e, 0x3e, 0x77, 0xdc }; |
| 630 | 628 | const msg = [_]u8{'a'} ** 97; |
lib/std/crypto/sha2.zig+1-1| ... | ... | @@ -238,7 +238,7 @@ fn Sha2x32(comptime params: Sha2Params32) type { |
| 238 | 238 | return; |
| 239 | 239 | }, |
| 240 | 240 | // C backend doesn't currently support passing vectors to inline asm. |
| 241 | .x86_64 => if (builtin.zig_backend != .stage2_c and builtin.zig_backend != .stage2_x86_64 and comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .sha, .avx2 })) { | |
| 241 | .x86_64 => if (builtin.zig_backend != .stage2_c and comptime std.Target.x86.featureSetHasAll(builtin.cpu.features, .{ .sha, .avx2 })) { | |
| 242 | 242 | var x: v4u32 = [_]u32{ d.s[5], d.s[4], d.s[1], d.s[0] }; |
| 243 | 243 | var y: v4u32 = [_]u32{ d.s[7], d.s[6], d.s[3], d.s[2] }; |
| 244 | 244 | const s_v = @as(*[16]v4u32, @ptrCast(&s)); |
lib/std/treap.zig-2| ... | ... | @@ -350,8 +350,6 @@ const TestTreap = Treap(u64, std.math.order); |
| 350 | 350 | const TestNode = TestTreap.Node; |
| 351 | 351 | |
| 352 | 352 | test "std.Treap: insert, find, replace, remove" { |
| 353 | if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest; | |
| 354 | ||
| 355 | 353 | var treap = TestTreap{}; |
| 356 | 354 | var nodes: [10]TestNode = undefined; |
| 357 | 355 |
src/arch/x86_64/CodeGen.zig+2| ... | ... | @@ -4740,6 +4740,7 @@ fn airArrayElemVal(self: *Self, inst: Air.Inst.Index) !void { |
| 4740 | 4740 | |
| 4741 | 4741 | // TODO we could allocate register here, but need to expect addr register and potentially |
| 4742 | 4742 | // offset register. |
| 4743 | try self.spillEflagsIfOccupied(); | |
| 4743 | 4744 | const dst_mcv = try self.allocRegOrMem(inst, false); |
| 4744 | 4745 | try self.genBinOpMir( |
| 4745 | 4746 | .{ ._, .add }, |
| ... | ... | @@ -14884,6 +14885,7 @@ fn truncateRegister(self: *Self, ty: Type, reg: Register) !void { |
| 14884 | 14885 | .bits = @intCast(ty.bitSize(mod)), |
| 14885 | 14886 | }; |
| 14886 | 14887 | const max_reg_bit_width = Register.rax.bitSize(); |
| 14888 | try self.spillEflagsIfOccupied(); | |
| 14887 | 14889 | switch (int_info.signedness) { |
| 14888 | 14890 | .signed => { |
| 14889 | 14891 | const shift: u6 = @intCast(max_reg_bit_width - int_info.bits); |