mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Update SM4 AES-NI implementation
This commit is contained in:
@@ -28,6 +28,7 @@ option(ENABLE_GMUL_ARM64 "Enable GF(2^128) Multiplication AArch64 assembly" OFF)
|
||||
|
||||
|
||||
option(ENABLE_SM4_AVX2 "Enable SM4 AVX2 8x implementation" OFF)
|
||||
option(ENABLE_SM4_AESNI "Enable SM4 AES-NI (4x) implementation" OFF)
|
||||
option(ENABLE_SM2_AMD64 "Enable SM2_Z256 X86_64 assembly" OFF)
|
||||
|
||||
|
||||
@@ -319,6 +320,14 @@ if (ENABLE_SM4_AVX2)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
||||
endif()
|
||||
|
||||
if (ENABLE_SM4_AESNI)
|
||||
message(STATUS "ENABLE_SM4_AESNI is ON")
|
||||
list(FIND src src/sm4.c sm4_index)
|
||||
list(REMOVE_AT src ${sm4_index})
|
||||
list(INSERT src ${sm4_index} src/sm4_aesni.c)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user