mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Use an array of comptime_int for shuffle masks
Suggested by @LemonBoy - Thanks!
This commit is contained in:
parent
9b386bda33
commit
459128e059
@ -35,8 +35,8 @@ const ChaCha20VecImpl = struct {
|
||||
}
|
||||
|
||||
inline fn chacha20Core(x: *BlockVec, input: BlockVec) void {
|
||||
const rot8 = Vector(16, i32){ 3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10, 15, 12, 13, 14 };
|
||||
const rot16 = Vector(16, i32){ 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13 };
|
||||
const rot8 = [_]i32{ 3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10, 15, 12, 13, 14 };
|
||||
const rot16 = [_]i32{ 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13 };
|
||||
|
||||
x.* = input;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user