aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Denis <github@pureftpd.org>2020-10-10 19:48:22 +0200
committerFrank Denis <github@pureftpd.org>2020-10-10 22:45:41 +0200
commit459128e05902008937205ea154e6c556e9264a4d (patch)
tree936cadca33367ffa758c3f24a050a4063c8eb515
parent9b386bda33e94c79d6b9a1db911d394c26592e71 (diff)
downloadzig-459128e05902008937205ea154e6c556e9264a4d.tar.gz
zig-459128e05902008937205ea154e6c556e9264a4d.zip
Use an array of comptime_int for shuffle masks
Suggested by @LemonBoy - Thanks!
-rw-r--r--lib/std/crypto/chacha20.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/crypto/chacha20.zig b/lib/std/crypto/chacha20.zig
index 6840dfb529..de9c1aab62 100644
--- a/lib/std/crypto/chacha20.zig
+++ b/lib/std/crypto/chacha20.zig
@@ -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;