parent
a46377caf7
commit
22b7d74e1f
2
gcm.cpp
2
gcm.cpp
|
|
@ -333,7 +333,7 @@ unsigned int GCM_Base::OptimalDataAlignment() const
|
||||||
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
|
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
|
||||||
HasSSE2() ? 16 :
|
HasSSE2() ? 16 :
|
||||||
#elif CRYPTOPP_ARM_NEON_AVAILABLE
|
#elif CRYPTOPP_ARM_NEON_AVAILABLE
|
||||||
HasNEON() ? 16 :
|
HasNEON() ? 4 :
|
||||||
#endif
|
#endif
|
||||||
GetBlockCipher().OptimalDataAlignment();
|
GetBlockCipher().OptimalDataAlignment();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,10 @@
|
||||||
# include <setjmp.h>
|
# include <setjmp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__APPLE__) && defined(__aarch64__)
|
||||||
|
# include <sys/utsname.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef EXCEPTION_EXECUTE_HANDLER
|
#ifndef EXCEPTION_EXECUTE_HANDLER
|
||||||
# define EXCEPTION_EXECUTE_HANDLER 1
|
# define EXCEPTION_EXECUTE_HANDLER 1
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -110,6 +114,27 @@ bool CPU_TryAES_ARMV8()
|
||||||
# elif defined(__linux__) && defined(__aarch32__)
|
# elif defined(__linux__) && defined(__aarch32__)
|
||||||
if (getauxval(AT_HWCAP2) & HWCAP2_AES)
|
if (getauxval(AT_HWCAP2) & HWCAP2_AES)
|
||||||
return true;
|
return true;
|
||||||
|
# elif defined(__APPLE__)
|
||||||
|
{
|
||||||
|
// https://stackoverflow.com/a/11197770/608639
|
||||||
|
// https://gist.github.com/erkanyildiz/390a480f27e86f8cd6ba
|
||||||
|
struct utsname systemInfo;
|
||||||
|
systemInfo.machine[0] = '\0';
|
||||||
|
uname(&systemInfo);
|
||||||
|
const char* machine = systemInfo.machine;
|
||||||
|
|
||||||
|
if (0==strcmp(machine, "iPhone6,1") || 0==strcmp(machine, "iPhone6,2") ||
|
||||||
|
0==strcmp(machine, "iPhone7,1") || 0==strcmp(machine, "iPhone7,2") ||
|
||||||
|
0==strcmp(machine, "iPad4,1") || 0==strcmp(machine, "iPad4,2") ||
|
||||||
|
0==strcmp(machine, "iPad4,3") || 0==strcmp(machine, "iPad4,4") ||
|
||||||
|
0==strcmp(machine, "iPad4,5") || 0==strcmp(machine, "iPad4,6") ||
|
||||||
|
0==strcmp(machine, "iPad4,7") || 0==strcmp(machine, "iPad4,8") ||
|
||||||
|
0==strcmp(machine, "iPad4,9") ||
|
||||||
|
0==strcmp(machine, "iPad5,3") || 0==strcmp(machine, "iPad5,4") )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// longjmp and clobber warnings. Volatile is required.
|
// longjmp and clobber warnings. Volatile is required.
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM rijndael.cpp" to generate MASM code
|
// use "cl /EP /P /DCRYPTOPP_GENERATE_X64_MASM rijndael.cpp" to generate MASM code
|
||||||
|
|
||||||
|
/*
|
||||||
|
July 2017: Added support for ARM AES instructions via compiler intrinsics.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
July 2010: Added support for AES-NI instructions via compiler intrinsics.
|
July 2010: Added support for AES-NI instructions via compiler intrinsics.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue