From 66de7ad0491264f4a0c179dac7e46dfbbd7ce7a1 Mon Sep 17 00:00:00 2001 From: Arm64 plaz Date: Tue, 24 Apr 2018 18:23:40 +0000 Subject: [PATCH] for first time disable aesenc for arm64 --- Makefile.linux | 7 ++++++- libi2pd/Crypto.cpp | 7 +++++++ libi2pd/Crypto.h | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile.linux b/Makefile.linux index 4a82591a..2c30bbb0 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -60,7 +60,12 @@ endif ifeq ($(USE_AESNI),yes) #check if AES-NI is supported by CPU ifneq ($(shell $(GREP) -c aes /proc/cpuinfo),0) - CPU_FLAGS += -maes -DAESNI + machine := $(shell uname -m) + ifeq ($(machine), aarch64) + CXXFLAGS += -DARM64AES + else + CPU_FLAGS += -maes -DAESNI + endif endif endif diff --git a/libi2pd/Crypto.cpp b/libi2pd/Crypto.cpp index 5ba3334d..b0473410 100644 --- a/libi2pd/Crypto.cpp +++ b/libi2pd/Crypto.cpp @@ -594,6 +594,13 @@ namespace crypto // AES #ifdef AESNI + #ifdef ARM64AES + void init_aesenc(void) __attribute__((constructor)){ + + } + + #endif + #define KeyExpansion256(round0,round1) \ "pshufd $0xff, %%xmm2, %%xmm2 \n" \ "movaps %%xmm1, %%xmm4 \n" \ diff --git a/libi2pd/Crypto.h b/libi2pd/Crypto.h index 6e4ddb3d..859f2d97 100644 --- a/libi2pd/Crypto.h +++ b/libi2pd/Crypto.h @@ -124,6 +124,9 @@ namespace crypto #ifdef AESNI + #ifdef ARM64AES + void init_aesenc(void) __attribute__((constructor)); + #endif class ECBCryptoAESNI { public: