Update SM4 API

This commit is contained in:
Zhi Guan
2024-04-27 12:08:35 +08:00
parent 3f1fdc147a
commit bc15f7a0c7
8 changed files with 157 additions and 113 deletions

View File

@@ -11,6 +11,8 @@ include_directories(include)
add_compile_options(-O3)
option(ENABLE_TEST_SPEED "Enable test speed" ON)
option(ENABLE_SM4_TBOX "Enable SM4 merged S-Box implementation" ON)
option(ENABLE_SM4_AARCH64 "Enable SM4 AARCH64 assembly implementation" OFF)
option(ENABLE_SM4_CTR_AESNI_AVX "Enable SM4 CTR AESNI+AVX assembly implementation" OFF)
@@ -30,7 +32,7 @@ option(ENABLE_GMUL_AARCH64 "Enable GF(2^128) Multiplication AArch64 assembly" OF
set(src
src/version.c
src/debug.c
src/sm4.c
src/sm4_arm_neon.c
src/sm4_cbc.c
src/sm4_ctr.c
src/sm4_gcm.c
@@ -84,6 +86,7 @@ set(src
src/tls12.c
src/tls13.c
src/file.c
src/file.c
)
set(tools
@@ -245,6 +248,12 @@ include(CheckSymbolExists)
# when an option has been enabled, `cmake ..` will not refresh the value
# use `cmake .. -DENABLE_XXX=OFF` to disable the option
if (ENABLE_TEST_SPEED)
message(STATUS "ENABLE_TEST_SPEED is ON")
add_definitions(-DENABLE_TEST_SPEED)
endif()
option(ENABLE_SM2_ALGOR_ID_ENCODE_NULL "Enable AlgorithmIdenifier with algorithm sm2sign_with_sm3 encode a NULL object as parameters" OFF)
if (ENABLE_SM2_ALGOR_ID_ENCODE_NULL)
message(STATUS "ENABLE_SM2_ALGOR_ID_ENCODE_NULL is ON")