| ... | ... | @@ -26,12 +26,7 @@ pub fn timingSafeEql(comptime T: type, a: T, b: T) bool { |
| 26 | 26 | if (@typeInfo(C) != .Int) { |
| 27 | 27 | @compileError("Elements to be compared must be integers"); |
| 28 | 28 | } |
| 29 | | const z = a ^ b; |
| 30 | | var acc = @as(C, 0); |
| 31 | | var i: usize = 0; |
| 32 | | while (i < info.len) : (i += 1) { |
| 33 | | acc |= z[i]; |
| 34 | | } |
| 29 | const acc = @reduce(.Or, a ^ b); |
| 35 | 30 | comptime const s = @typeInfo(C).Int.bits; |
| 36 | 31 | comptime const Cu = std.meta.Int(.unsigned, s); |
| 37 | 32 | comptime const Cext = std.meta.Int(.unsigned, s + 1); |