File tree 3 files changed +499
-2
lines changed
3 files changed +499
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,15 @@ const builtin = std.builtin;
10
10
11
11
const has_aesni = comptime std .Target .x86 .featureSetHas (std .Target .current .cpu .features , .aes );
12
12
const has_avx = comptime std .Target .x86 .featureSetHas (std .Target .current .cpu .features , .avx );
13
- const impl = if (std .Target .current .cpu .arch == .x86_64 and has_aesni and has_avx ) @import ("aes/aesni.zig" ) else @import ("aes/soft.zig" );
13
+ const has_armaes = comptime std .Target .aarch64 .featureSetHas (std .Target .current .cpu .features , .aes );
14
+ const impl = if (std .Target .current .cpu .arch == .x86_64 and has_aesni and has_avx ) impl : {
15
+ break :impl @import ("aes/aesni.zig" );
16
+ } else if (std .Target .current .cpu .arch == .aarch64 and has_armaes )
17
+ impl : {
18
+ break :impl @import ("aes/armcrypto.zig" );
19
+ } else impl : {
20
+ break :impl @import ("aes/soft.zig" );
21
+ };
14
22
15
23
pub const Block = impl .Block ;
16
24
pub const AESEncryptCtx = impl .AESEncryptCtx ;
Original file line number Diff line number Diff line change 3
3
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
4
4
// The MIT license requires this copyright notice to be included in all copies
5
5
// and substantial portions of the software.
6
- // Based on Go stdlib implementation
7
6
8
7
const std = @import ("../../std.zig" );
9
8
const mem = std .mem ;
You can’t perform that action at this time.
0 commit comments