fix(sm2): fix ENABLE_SM2_NEON macro mismatch and add missing functions

Problems:
1. CMakeLists.txt defines -DENABLE_SM2_NEON but sm2_z256.c checks
   for ENABLE_SM2_Z256_NEON, causing NEON code path never taken
2. When NEON is enabled, sm2_z256_modp_mont_sqr, sm2_z256_modp_from_mont,
   and sm2_z256_modp_to_mont are missing due to #elif structure

Fixes:
1. Change add_definitions(-DENABLE_SM2_NEON) to
   add_definitions(-DENABLE_SM2_Z256_NEON) in CMakeLists.txt
2. Add the three missing wrapper functions in NEON code block
This commit is contained in:
libo
2026-02-02 15:02:55 +08:00
parent e0f5ed85e3
commit 0299af5667
2 changed files with 23 additions and 1 deletions

View File

@@ -281,7 +281,7 @@ endif()
if (ENABLE_SM2_NEON)
message(STATUS "ENABLE_SM2_NEON is ON")
add_definitions(-DENABLE_SM2_NEON)
add_definitions(-DENABLE_SM2_Z256_NEON)
endif()
if (ENABLE_SM9_ARM64)