diff options
author | Jack Lloyd <[email protected]> | 2019-09-01 07:16:58 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-09-01 09:03:54 -0400 |
commit | 1456e825379a8621fbb8cd8c5c7e7e3201ddd2fe (patch) | |
tree | 24349d15adbd75466557d4a929703e0633cbf2f7 /src/lib/utils/cpuid | |
parent | 3a3a7b38160dbfd76fc0e073b23e7f35e480cbd9 (diff) |
Support NEON for AES vector permutes
Rename aes_ssse3 -> aes_vperm
Diffstat (limited to 'src/lib/utils/cpuid')
-rw-r--r-- | src/lib/utils/cpuid/cpuid.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/utils/cpuid/cpuid.h b/src/lib/utils/cpuid/cpuid.h index 256c6cc57..f50f40f1d 100644 --- a/src/lib/utils/cpuid/cpuid.h +++ b/src/lib/utils/cpuid/cpuid.h @@ -303,6 +303,21 @@ class BOTAN_PUBLIC_API(2,1) CPUID final { return has_cpuid_bit(CPUID_RDSEED_BIT); } #endif + /** + * Check if the processor supports byte-level vector permutes + * (SSSE3, NEON, Altivec) + */ + static bool has_vperm() + { +#if defined(BOTAN_TARGET_CPU_IS_X86_FAMILY) + return has_ssse3(); +#elif defined(BOTAN_TARGET_CPU_IS_ARM_FAMILY) + return has_neon(); +#else + return false; +#endif + } + /* * Clear a CPUID bit * Call CPUID::initialize to reset |