Skip to content

Commit 48b6234

Browse files
committed
exclude AESNI option
1 parent 65da550 commit 48b6234

11 files changed

+8
-49
lines changed

Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ DAEMON_SRC_DIR := daemon
2929
# import source files lists
3030
include filelist.mk
3131

32-
USE_AESNI := $(or $(USE_AESNI),yes)
3332
USE_STATIC := $(or $(USE_STATIC),no)
3433
USE_UPNP := $(or $(USE_UPNP),no)
3534
DEBUG := $(or $(DEBUG),yes)

Makefile.homebrew

-7
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ ifeq ($(USE_UPNP),yes)
3030
INCFLAGS += -I${UPNPROOT}/include
3131
endif
3232

33-
ifeq ($(USE_AESNI),yes)
34-
ifneq (, $(findstring i386, $(SYS))$(findstring i686, $(SYS))$(findstring x86_64, $(SYS))) # only x86-based CPU supports that
35-
NEEDED_CXXFLAGS += -maes
36-
DEFINES += -D__AES__
37-
endif
38-
endif
39-
4033
install: all
4134
install -d ${PREFIX}/bin
4235
install -m 755 ${I2PD} ${PREFIX}/bin

Makefile.linux

-7
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ ifeq ($(USE_UPNP),yes)
5151
DEFINES += -DUSE_UPNP
5252
endif
5353

54-
ifeq ($(USE_AESNI),yes)
55-
ifneq (, $(findstring i386, $(SYS))$(findstring i686, $(SYS))$(findstring x86_64, $(SYS))) # only x86-based CPU supports that
56-
NEEDED_CXXFLAGS += -maes
57-
DEFINES += -D__AES__
58-
endif
59-
endif
60-
6154
install: all
6255
install -d ${PREFIX}/bin
6356
install -m 755 ${I2PD} ${PREFIX}/bin

Makefile.mingw

-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ ifeq ($(USE_WIN32_APP), yes)
4242
DAEMON_OBJS += $(patsubst %.rc,obj/%.o,$(DAEMON_RC))
4343
endif
4444

45-
ifeq ($(USE_AESNI),yes)
46-
NEEDED_CXXFLAGS += -maes
47-
LDFLAGS += -maes
48-
DEFINES += -D__AES__
49-
endif
50-
5145
ifeq ($(USE_ASLR),yes)
5246
LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va -Wl,--dynamicbase,--export-all-symbols
5347
endif

Makefile.osx

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,5 @@ endif
2525
OSARCH = $(shell uname -p)
2626

2727
ifneq ($(OSARCH),powerpc)
28-
ifeq ($(USE_AESNI),yes)
29-
CXXFLAGS += -D__AES__ -maes
30-
else
31-
CXXFLAGS += -msse
32-
endif
28+
CXXFLAGS += -msse
3329
endif

build/CMakeLists.txt

-12
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ project(
2929
)
3030

3131
# configurable options
32-
option(WITH_AESNI "Use AES-NI instructions set" ON)
3332
option(WITH_HARDENING "Use hardening compiler flags" OFF)
3433
option(WITH_LIBRARY "Build library" ON)
3534
option(WITH_BINARY "Build binary" ON)
@@ -185,16 +184,6 @@ if(UNIX)
185184
endif()
186185
endif()
187186

188-
# Note: AES-NI and AVX is available on x86-based CPU's.
189-
# Here also ARM64 implementation, but currently we don't support it.
190-
# MSVC is not supported due to different ASM processing, so we hope OpenSSL has its own checks to run optimized code.
191-
if(WITH_AESNI AND (ARCHITECTURE MATCHES "x86_64" OR ARCHITECTURE MATCHES "i386"))
192-
if(NOT MSVC)
193-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
194-
endif()
195-
add_definitions(-D__AES__)
196-
endif()
197-
198187
if(WITH_ADDRSANITIZER)
199188
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
200189
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
@@ -335,7 +324,6 @@ message(STATUS "Architecture : ${ARCHITECTURE}")
335324
message(STATUS "Compiler flags : ${CMAKE_CXX_FLAGS}")
336325
message(STATUS "Install prefix: : ${CMAKE_INSTALL_PREFIX}")
337326
message(STATUS "Options:")
338-
message(STATUS " AESNI : ${WITH_AESNI}")
339327
message(STATUS " HARDENING : ${WITH_HARDENING}")
340328
message(STATUS " LIBRARY : ${WITH_LIBRARY}")
341329
message(STATUS " BINARY : ${WITH_BINARY}")

daemon/Daemon.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,10 @@ namespace util
149149
LogPrint(eLogDebug, "FS: Certificates directory: ", certsdir);
150150

151151
bool precomputation; i2p::config::GetOption("precomputation.elgamal", precomputation);
152-
bool aesni; i2p::config::GetOption("cpuext.aesni", aesni);
153-
bool forceCpuExt; i2p::config::GetOption("cpuext.force", forceCpuExt);
154152
bool ssu; i2p::config::GetOption("ssu", ssu);
155153
if (!ssu && i2p::config::IsDefault ("precomputation.elgamal"))
156154
precomputation = false; // we don't elgamal table if no ssu, unless it's specified explicitly
157-
i2p::crypto::InitCrypto (precomputation, aesni, forceCpuExt);
155+
i2p::crypto::InitCrypto (precomputation);
158156

159157
i2p::transport::InitAddressFromIface (); // get address4/6 from interfaces
160158

libi2pd/Config.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,11 @@ namespace config {
315315
("persist.addressbook", value<bool>()->default_value(true), "Persist full addresses (default: true)")
316316
;
317317

318-
options_description cpuext("CPU encryption extensions options");
318+
options_description cpuext("CPU encryption extensions options. Deprecated");
319319
cpuext.add_options()
320-
("cpuext.aesni", bool_switch()->default_value(true), "Use auto detection for AESNI CPU extensions. If false, AESNI will be not used")
320+
("cpuext.aesni", bool_switch()->default_value(true), "Deprecated option")
321321
("cpuext.avx", bool_switch()->default_value(false), "Deprecated option")
322-
("cpuext.force", bool_switch()->default_value(false), "Force usage of CPU extensions. Useful when cpuinfo is not available on virtual machines")
322+
("cpuext.force", bool_switch()->default_value(false), "Deprecated option")
323323
;
324324

325325
options_description meshnets("Meshnet transports options");

libi2pd/Crypto.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ namespace crypto
834834
}
835835
}*/
836836

837-
void InitCrypto (bool precomputation, bool aesni, bool force)
837+
void InitCrypto (bool precomputation)
838838
{
839839
/* auto numLocks = CRYPTO_num_locks();
840840
for (int i = 0; i < numLocks; i++)

libi2pd/Crypto.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ namespace crypto
221221
void InitNoiseIKState (NoiseSymmetricState& state, const uint8_t * pub); // Noise_IK (ratchets)
222222

223223
// init and terminate
224-
void InitCrypto (bool precomputation, bool aesni, bool force);
224+
void InitCrypto (bool precomputation);
225225
void TerminateCrypto ();
226226
}
227227
}

libi2pd/api.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ namespace api
3737
i2p::fs::Init();
3838

3939
bool precomputation; i2p::config::GetOption("precomputation.elgamal", precomputation);
40-
bool aesni; i2p::config::GetOption("cpuext.aesni", aesni);
41-
bool forceCpuExt; i2p::config::GetOption("cpuext.force", forceCpuExt);
42-
i2p::crypto::InitCrypto (precomputation, aesni, forceCpuExt);
40+
i2p::crypto::InitCrypto (precomputation);
4341

4442
int netID; i2p::config::GetOption("netid", netID);
4543
i2p::context.SetNetID (netID);

0 commit comments

Comments
 (0)