diff --git a/core/crypto/_aes/hw_intel/api.odin b/core/crypto/_aes/hw_intel/api.odin index 5cb5a68bb..1796bb093 100644 --- a/core/crypto/_aes/hw_intel/api.odin +++ b/core/crypto/_aes/hw_intel/api.odin @@ -3,7 +3,7 @@ package aes_hw_intel import "core:sys/info" -// is_supporte returns true iff hardware accelerated AES +// is_supported returns true iff hardware accelerated AES // is supported. is_supported :: proc "contextless" () -> bool { features, ok := info.cpu_features.? diff --git a/core/crypto/_aes/hw_intel/ghash.odin b/core/crypto/_aes/hw_intel/ghash.odin index 9a5208523..39351393f 100644 --- a/core/crypto/_aes/hw_intel/ghash.odin +++ b/core/crypto/_aes/hw_intel/ghash.odin @@ -25,7 +25,6 @@ package aes_hw_intel import "base:intrinsics" import "core:crypto/_aes" -import "core:simd" import "core:simd/x86" @(private = "file") @@ -58,14 +57,11 @@ GHASH_STRIDE_BYTES_HW :: GHASH_STRIDE_HW * _aes.GHASH_BLOCK_SIZE // chunks. We number chunks from 0 to 3 in left to right order. @(private = "file") -byteswap_index := transmute(x86.__m128i)simd.i8x16{ - // Note: simd.i8x16 is reverse order from x86._mm_set_epi8. - 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -} +_BYTESWAP_INDEX: x86.__m128i : { 0x08090a0b0c0d0e0f, 0x0001020304050607 } @(private = "file", require_results, enable_target_feature = "sse2,ssse3") byteswap :: #force_inline proc "contextless" (x: x86.__m128i) -> x86.__m128i { - return x86._mm_shuffle_epi8(x, byteswap_index) + return x86._mm_shuffle_epi8(x, _BYTESWAP_INDEX) } // From a 128-bit value kw, compute kx as the XOR of the two 64-bit