Browse Source

for first time disable aesenc for arm64

pull/1166/head
Arm64 plaz 7 years ago
parent
commit
66de7ad049
  1. 5
      Makefile.linux
  2. 7
      libi2pd/Crypto.cpp
  3. 3
      libi2pd/Crypto.h

5
Makefile.linux

@ -60,9 +60,14 @@ endif
ifeq ($(USE_AESNI),yes) ifeq ($(USE_AESNI),yes)
#check if AES-NI is supported by CPU #check if AES-NI is supported by CPU
ifneq ($(shell $(GREP) -c aes /proc/cpuinfo),0) ifneq ($(shell $(GREP) -c aes /proc/cpuinfo),0)
machine := $(shell uname -m)
ifeq ($(machine), aarch64)
CXXFLAGS += -DARM64AES
else
CPU_FLAGS += -maes -DAESNI CPU_FLAGS += -maes -DAESNI
endif endif
endif endif
endif
ifeq ($(USE_AVX),yes) ifeq ($(USE_AVX),yes)
#check if AVX supported by CPU #check if AVX supported by CPU

7
libi2pd/Crypto.cpp

@ -594,6 +594,13 @@ namespace crypto
// AES // AES
#ifdef AESNI #ifdef AESNI
#ifdef ARM64AES
void init_aesenc(void) __attribute__((constructor)){
}
#endif
#define KeyExpansion256(round0,round1) \ #define KeyExpansion256(round0,round1) \
"pshufd $0xff, %%xmm2, %%xmm2 \n" \ "pshufd $0xff, %%xmm2, %%xmm2 \n" \
"movaps %%xmm1, %%xmm4 \n" \ "movaps %%xmm1, %%xmm4 \n" \

3
libi2pd/Crypto.h

@ -124,6 +124,9 @@ namespace crypto
#ifdef AESNI #ifdef AESNI
#ifdef ARM64AES
void init_aesenc(void) __attribute__((constructor));
#endif
class ECBCryptoAESNI class ECBCryptoAESNI
{ {
public: public:

Loading…
Cancel
Save