Update comments in config.h

Some comments in config.h were old. Time for a refresh.
Switch from CRYPTOPP_BOOL_ARM64 to CRYPTOPP_BOOL_ARMV8. Aarch32 is ARMv8, and that's the important part.
This commit is contained in:
Jeffrey Walton 2018-12-09 10:24:55 -05:00
parent fbb9b40397
commit 0aa217b91c
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
13 changed files with 30 additions and 35 deletions

View File

@ -14,3 +14,5 @@ mkdir -p "$ANDROID_NDK_ROOT"
# https://stackoverflow.com/a/47028911/608639 # https://stackoverflow.com/a/47028911/608639
touch "$ANDROID_HOME/repositories.cfg" touch "$ANDROID_HOME/repositories.cfg"
[[ "$0" = "${BASH_SOURCE[0]}" ]] && exit 0 || return 0

View File

@ -57,7 +57,7 @@
// Define this to disable ASM, intrinsics and built-ins. The library will be // Define this to disable ASM, intrinsics and built-ins. The library will be
// compiled using C++ only. The library code will not include SSE2 (and // compiled using C++ only. The library code will not include SSE2 (and
// above), NEON, Aarch32, Aarch64, Power4, Power7 or Power8. Note the compiler // above), NEON, Aarch32, Aarch64, or Altivec (and above). Note the compiler
// may use higher ISAs depending on compiler options, but the library will not // may use higher ISAs depending on compiler options, but the library will not
// explictly use the ISAs. When disabling ASM, it is best to do it from // explictly use the ISAs. When disabling ASM, it is best to do it from
// config.h to ensure the library and all programs share the setting. // config.h to ensure the library and all programs share the setting.
@ -400,16 +400,8 @@ NAMESPACE_END
#ifdef _MSC_VER #ifdef _MSC_VER
// 4127: conditional expression is constant // 4127: conditional expression is constant
// 4231: nonstandard extension used : 'extern' before template explicit instantiation
// 4250: dominance
// 4251: member needs to have dll-interface
// 4275: base needs to have dll-interface
// 4505: unreferenced local function
// 4512: assignment operator not generated // 4512: assignment operator not generated
// 4660: explicitly instantiating a class that's already implicitly instantiated
// 4661: no suitable definition provided for explicit template instantiation request // 4661: no suitable definition provided for explicit template instantiation request
// 4786: identifier was truncated in debug information
// 4355: 'this' : used in base member initializer list
// 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation // 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
# pragma warning(disable: 4127 4512 4661 4910) # pragma warning(disable: 4127 4512 4661 4910)
// Security related, possible defects // Security related, possible defects
@ -441,9 +433,11 @@ NAMESPACE_END
// ***************** Platform and CPU features ******************** // ***************** Platform and CPU features ********************
// Linux provides X32, which is 32-bit integers, longs and pointers on x86_64 using the full x86_64 register set. // Linux provides X32, which is 32-bit integers, longs and pointers on x86_64
// Detect via __ILP32__ (http://wiki.debian.org/X32Port). However, __ILP32__ shows up in more places than // using the full x86_64 register set. Detect via __ILP32__
// the System V ABI specs calls out, like on some Solaris installations and just about any 32-bit system with Clang. // (http://wiki.debian.org/X32Port). However, __ILP32__ shows up in more places
// than the System V ABI specs calls out, like on some Solaris installations
// and just about any 32-bit system with Clang.
#if (defined(__ILP32__) || defined(_ILP32)) && defined(__x86_64__) #if (defined(__ILP32__) || defined(_ILP32)) && defined(__x86_64__)
#define CRYPTOPP_BOOL_X32 1 #define CRYPTOPP_BOOL_X32 1
#endif #endif
@ -457,23 +451,22 @@ NAMESPACE_END
#define CRYPTOPP_BOOL_X64 1 #define CRYPTOPP_BOOL_X64 1
#endif #endif
// Undo the ASM and Intrinsic related defines due to X32. // Undo the ASM related defines due to X32.
#if CRYPTOPP_BOOL_X32 #if CRYPTOPP_BOOL_X32
# undef CRYPTOPP_BOOL_X64 # undef CRYPTOPP_BOOL_X64
# undef CRYPTOPP_X64_ASM_AVAILABLE # undef CRYPTOPP_X64_ASM_AVAILABLE
# undef CRYPTOPP_X64_MASM_AVAILABLE # undef CRYPTOPP_X64_MASM_AVAILABLE
#endif #endif
// Microsoft plans to support ARM-64, but its not clear how to detect it. // Microsoft added ARM64 define December 2017.
// TODO: Add MSC_VER and ARM-64 platform define when available #if defined(__arm64__) || defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64)
#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) #define CRYPTOPP_BOOL_ARMV8 1
#define CRYPTOPP_BOOL_ARM64 1 #elif defined(__arm__) || defined(_M_ARM)
#elif defined(__arm__) || defined(__aarch32__) || defined(_M_ARM)
#define CRYPTOPP_BOOL_ARM32 1 #define CRYPTOPP_BOOL_ARM32 1
#endif #endif
// AltiVec and Power8 crypto // AltiVec and Power8 crypto
#if defined(__powerpc64__) || defined(_ARCH_PPC64) #if defined(__ppc64__) || defined(__powerpc64__) || defined(_ARCH_PPC64)
#define CRYPTOPP_BOOL_PPC64 1 #define CRYPTOPP_BOOL_PPC64 1
#elif defined(__powerpc__) || defined(_ARCH_PPC) #elif defined(__powerpc__) || defined(_ARCH_PPC)
#define CRYPTOPP_BOOL_PPC32 1 #define CRYPTOPP_BOOL_PPC32 1
@ -629,7 +622,7 @@ NAMESPACE_END
// ***************** ARM CPU features ******************** // ***************** ARM CPU features ********************
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
// We don't have an ARM big endian test rig. Disable // We don't have an ARM big endian test rig. Disable
// ARM-BE ASM and instrinsics until we can test it. // ARM-BE ASM and instrinsics until we can test it.

View File

@ -435,7 +435,7 @@ void DetectX86Features()
// *************************** ARM-32, Aarch32 and Aarch64 *************************** // *************************** ARM-32, Aarch32 and Aarch64 ***************************
#elif (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #elif (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
bool CRYPTOPP_SECTION_INIT g_ArmDetectionDone = false; bool CRYPTOPP_SECTION_INIT g_ArmDetectionDone = false;
bool CRYPTOPP_SECTION_INIT g_hasARMv7 = false; bool CRYPTOPP_SECTION_INIT g_hasARMv7 = false;
@ -1050,7 +1050,7 @@ public:
{ {
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64
CryptoPP::DetectX86Features(); CryptoPP::DetectX86Features();
#elif CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 #elif CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8
CryptoPP::DetectArmFeatures(); CryptoPP::DetectArmFeatures();
#elif CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64 #elif CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
CryptoPP::DetectPowerpcFeatures(); CryptoPP::DetectPowerpcFeatures();

4
cpu.h
View File

@ -337,7 +337,7 @@ inline int GetCacheLineSize()
// ***************************** ARM-32, Aarch32 and Aarch64 ***************************** // // ***************************** ARM-32, Aarch32 and Aarch64 ***************************** //
#if CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 || CRYPTOPP_DOXYGEN_PROCESSING #if CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8 || CRYPTOPP_DOXYGEN_PROCESSING
// Hide from Doxygen // Hide from Doxygen
#ifndef CRYPTOPP_DOXYGEN_PROCESSING #ifndef CRYPTOPP_DOXYGEN_PROCESSING
@ -579,7 +579,7 @@ inline bool HasSM4()
//@} //@}
#endif // CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 #endif // CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8
// ***************************** PowerPC ***************************** // // ***************************** PowerPC ***************************** //

View File

@ -49,7 +49,7 @@ extern "C" {
} }
#endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY #endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
bool CPU_ProbeCRC32() bool CPU_ProbeCRC32()
{ {

View File

@ -277,7 +277,7 @@ extern "C" {
} }
#endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY #endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
bool CPU_ProbePMULL() bool CPU_ProbePMULL()
{ {
#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)

2
lea.h
View File

@ -15,7 +15,7 @@
#include "secblock.h" #include "secblock.h"
#include "algparam.h" #include "algparam.h"
#if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #if (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
# define CRYPTOPP_LEA_ADVANCED_PROCESS_BLOCKS 1 # define CRYPTOPP_LEA_ADVANCED_PROCESS_BLOCKS 1
#endif #endif

View File

@ -20,7 +20,7 @@
#endif #endif
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || \ #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_ARM32 || \
CRYPTOPP_BOOL_ARM64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64 CRYPTOPP_BOOL_ARMV8 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
# define CRYPTOPP_RIJNDAEL_ADVANCED_PROCESS_BLOCKS 1 # define CRYPTOPP_RIJNDAEL_ADVANCED_PROCESS_BLOCKS 1
#endif #endif

View File

@ -75,7 +75,7 @@ extern "C" {
} }
#endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY #endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
bool CPU_ProbeAES() bool CPU_ProbeAES()
{ {
#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)

View File

@ -73,7 +73,7 @@ extern "C" {
} }
#endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY #endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY
#if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #if (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
bool CPU_ProbeSHA1() bool CPU_ProbeSHA1()
{ {
#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)

View File

@ -18,13 +18,13 @@
#include "secblock.h" #include "secblock.h"
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \ #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \
CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 || \ CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8 || \
CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64 CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
# define CRYPTOPP_SIMON64_ADVANCED_PROCESS_BLOCKS 1 # define CRYPTOPP_SIMON64_ADVANCED_PROCESS_BLOCKS 1
#endif #endif
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \ #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \
CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 || \ CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8 || \
CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64 CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
# define CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS 1 # define CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS 1
#endif #endif

View File

@ -18,13 +18,13 @@
#include "secblock.h" #include "secblock.h"
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \ #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \
CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 || \ CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8 || \
CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64 CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
# define CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS 1 # define CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS 1
#endif #endif
#if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \ #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || \
CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64 || \ CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8 || \
CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64 CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64
# define CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS 1 # define CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS 1
#endif #endif

View File

@ -356,7 +356,7 @@ bool TestSettings()
std::cout << ", hasSHA == " << hasSHA << ", isP4 == " << isP4; std::cout << ", hasSHA == " << hasSHA << ", isP4 == " << isP4;
std::cout << "\n"; std::cout << "\n";
#elif (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARM64) #elif (CRYPTOPP_BOOL_ARM32 || CRYPTOPP_BOOL_ARMV8)
# if defined(__arm__) # if defined(__arm__)
bool hasARMv7 = HasARMv7(); bool hasARMv7 = HasARMv7();