summaryrefslogtreecommitdiff
path: root/cpu.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-03-05 13:07:24 -0500
committerJeffrey Walton <noloader@gmail.com>2021-03-05 13:07:24 -0500
commit443e3ee8369e0e405e97e2a3ecb6374d30012111 (patch)
tree2f19c1782c6cbe8ea92afdb3a7fb487bb5f25342 /cpu.h
parent0a2d9d89ace8381bc3ed5aeb145e4ff18d10212a (diff)
downloadcryptopp-git-443e3ee8369e0e405e97e2a3ecb6374d30012111.tar.gz
Update cpu.cpp features for Apple M1
Diffstat (limited to 'cpu.h')
-rw-r--r--cpu.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/cpu.h b/cpu.h
index 26680e96..75f39efe 100644
--- a/cpu.h
+++ b/cpu.h
@@ -579,41 +579,41 @@ inline bool HasSHA2()
#endif
}
-/// \brief Determine if an ARM processor has SHA512 available
-/// \return true if the hardware is capable of SHA512 at runtime, false otherwise.
-/// \details SHA512 is part of the ARMv8.4 Crypto extensions on Aarch32 and Aarch64. They
+/// \brief Determine if an ARM processor has SHA3 available
+/// \return true if the hardware is capable of SHA3 at runtime, false otherwise.
+/// \details SHA3 is part of the ARMv8.2 Crypto extensions on Aarch32 and Aarch64. They
/// are accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
/// \details Runtime support requires compile time support. When compiling with GCC, you
-/// may need to compile with <tt>-march=armv8.4-a+crypto</tt>; while Apple requires
+/// may need to compile with <tt>-march=armv8.2-a+crypto</tt>; while Apple requires
/// <tt>-arch arm64</tt>. Also see ARM's <tt>__ARM_FEATURE_CRYPTO</tt> preprocessor macro.
/// \since Crypto++ 8.0
/// \note This function is only available on Aarch32 and Aarch64 platforms
-inline bool HasSHA512()
+inline bool HasSHA3()
{
#if defined(__aarch32__) || defined(__aarch64__)
if (!g_ArmDetectionDone)
DetectArmFeatures();
- return g_hasSHA512;
+ return g_hasSHA3;
#else
return false;
#endif
}
-/// \brief Determine if an ARM processor has SHA3 available
-/// \return true if the hardware is capable of SHA3 at runtime, false otherwise.
-/// \details SHA3 is part of the ARMv8.4 Crypto extensions on Aarch32 and Aarch64. They
+/// \brief Determine if an ARM processor has SHA512 available
+/// \return true if the hardware is capable of SHA512 at runtime, false otherwise.
+/// \details SHA512 is part of the ARMv8.2 Crypto extensions on Aarch32 and Aarch64. They
/// are accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
/// \details Runtime support requires compile time support. When compiling with GCC, you
-/// may need to compile with <tt>-march=armv8.4-a+crypto</tt>; while Apple requires
+/// may need to compile with <tt>-march=armv8.2-a+crypto</tt>; while Apple requires
/// <tt>-arch arm64</tt>. Also see ARM's <tt>__ARM_FEATURE_CRYPTO</tt> preprocessor macro.
/// \since Crypto++ 8.0
/// \note This function is only available on Aarch32 and Aarch64 platforms
-inline bool HasSHA3()
+inline bool HasSHA512()
{
#if defined(__aarch32__) || defined(__aarch64__)
if (!g_ArmDetectionDone)
DetectArmFeatures();
- return g_hasSHA3;
+ return g_hasSHA512;
#else
return false;
#endif