Changeset View
Changeset View
Standalone View
Standalone View
src/hwfeatures.c
| Context not available. | |||||
| { | { | ||||
| unsigned int flag; | unsigned int flag; | ||||
| const char *desc; | const char *desc; | ||||
| } hwflist[] = | } hwflist[] = | ||||
| { | { | ||||
| #if defined(HAVE_CPU_ARCH_X86) | |||||
| { HWF_PADLOCK_RNG, "padlock-rng" }, | { HWF_PADLOCK_RNG, "padlock-rng" }, | ||||
| { HWF_PADLOCK_AES, "padlock-aes" }, | { HWF_PADLOCK_AES, "padlock-aes" }, | ||||
| { HWF_PADLOCK_SHA, "padlock-sha" }, | { HWF_PADLOCK_SHA, "padlock-sha" }, | ||||
| { HWF_PADLOCK_MMUL, "padlock-mmul"}, | { HWF_PADLOCK_MMUL, "padlock-mmul"}, | ||||
| { HWF_INTEL_CPU, "intel-cpu" }, | { HWF_INTEL_CPU, "intel-cpu" }, | ||||
| Context not available. | |||||
| { HWF_INTEL_AVX, "intel-avx" }, | { HWF_INTEL_AVX, "intel-avx" }, | ||||
| { HWF_INTEL_AVX2, "intel-avx2" }, | { HWF_INTEL_AVX2, "intel-avx2" }, | ||||
| { HWF_INTEL_FAST_VPGATHER, "intel-fast-vpgather" }, | { HWF_INTEL_FAST_VPGATHER, "intel-fast-vpgather" }, | ||||
| { HWF_INTEL_RDTSC, "intel-rdtsc" }, | { HWF_INTEL_RDTSC, "intel-rdtsc" }, | ||||
| { HWF_INTEL_SHAEXT, "intel-shaext" }, | { HWF_INTEL_SHAEXT, "intel-shaext" }, | ||||
| #elif defined(HAVE_CPU_ARCH_ARM) | |||||
| { HWF_ARM_NEON, "arm-neon" }, | { HWF_ARM_NEON, "arm-neon" }, | ||||
| { HWF_ARM_AES, "arm-aes" }, | { HWF_ARM_AES, "arm-aes" }, | ||||
| { HWF_ARM_SHA1, "arm-sha1" }, | { HWF_ARM_SHA1, "arm-sha1" }, | ||||
| { HWF_ARM_SHA2, "arm-sha2" }, | { HWF_ARM_SHA2, "arm-sha2" }, | ||||
| { HWF_ARM_PMULL, "arm-pmull" } | { HWF_ARM_PMULL, "arm-pmull" }, | ||||
| #elif defined(HAVE_CPU_ARCH_PPC) | |||||
| { HWF_PPC_VCRYPTO, "ppc-crypto" }, | |||||
| #endif | |||||
| }; | }; | ||||
| /* A bit vector with the hardware features which shall not be used. | /* A bit vector with the hardware features which shall not be used. | ||||
| This variable must be set prior to any initialization. */ | This variable must be set prior to any initialization. */ | ||||
| static unsigned int disabled_hw_features; | static unsigned int disabled_hw_features; | ||||
| Context not available. | |||||
| #if defined (HAVE_CPU_ARCH_X86) | #if defined (HAVE_CPU_ARCH_X86) | ||||
| { | { | ||||
| hw_features = _gcry_hwf_detect_x86 (); | hw_features = _gcry_hwf_detect_x86 (); | ||||
| } | } | ||||
| #endif /* HAVE_CPU_ARCH_X86 */ | #elif defined (HAVE_CPU_ARCH_ARM) | ||||
| #if defined (HAVE_CPU_ARCH_ARM) | |||||
| { | { | ||||
| hw_features = _gcry_hwf_detect_arm (); | hw_features = _gcry_hwf_detect_arm (); | ||||
| } | } | ||||
| #endif /* HAVE_CPU_ARCH_ARM */ | #elif defined (HAVE_CPU_ARCH_PPC) | ||||
| { | |||||
| hw_features = _gcry_hwf_detect_ppc (); | |||||
| } | |||||
| #endif | |||||
| hw_features &= ~disabled_hw_features; | hw_features &= ~disabled_hw_features; | ||||
| } | } | ||||
| Context not available. | |||||