From 25ce3134f83a13d466699192ae218e90e3c2ce0a Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Sun, 14 Jun 2026 16:09:57 +0800 Subject: [PATCH] Update gf128 --- CMakeLists.txt | 3 +-- include/gmssl/version.h | 2 +- src/gf128.c | 7 +------ src/gf128_arm64.c | 1 - 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0a7d0df..b5d31751 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,7 +236,6 @@ if (ENABLE_GMUL_ARM64) message(STATUS "ENABLE_GMUL_ARM64 is ON") add_definitions(-DENABLE_GMUL_ARM64) enable_language(ASM) - #list(APPEND src src/gf128_arm64.S) list(APPEND src src/gf128_arm64.c) endif() @@ -764,7 +763,7 @@ endif() # set(CPACK_PACKAGE_NAME "GmSSL") set(CPACK_PACKAGE_VENDOR "GmSSL develop team") -set(CPACK_PACKAGE_VERSION "3.2.0-dev.1044") +set(CPACK_PACKAGE_VERSION "3.2.0-dev.1045") set(CPACK_PACKAGE_DESCRIPTION_FILE ${PROJECT_SOURCE_DIR}/README.md) set(CPACK_NSIS_MODIFY_PATH ON) include(CPack) diff --git a/include/gmssl/version.h b/include/gmssl/version.h index 2343dd98..4a014613 100644 --- a/include/gmssl/version.h +++ b/include/gmssl/version.h @@ -19,7 +19,7 @@ extern "C" { // Also update CPACK_PACKAGE_VERSION in CMakeLists.txt #define GMSSL_VERSION_NUM 30200 -#define GMSSL_VERSION_STR "GmSSL 3.2.0-dev.1044" +#define GMSSL_VERSION_STR "GmSSL 3.2.0-dev.1045" int gmssl_version_num(void); const char *gmssl_version_str(void); diff --git a/src/gf128.c b/src/gf128.c index 2c4b910b..6e1319fe 100644 --- a/src/gf128.c +++ b/src/gf128.c @@ -68,12 +68,8 @@ int gf128_print(FILE *fp, int fmt, int ind, const char *label, const gf128_t a) uint8_t be[16]; int i; - printf("%s: ", label); gf128_to_bytes(a, be); - for (i = 0; i < 16; i++) { - printf("%02x", be[i]); - } - printf("\n"); + format_bytes(fp, fmt, ind, label, be, sizeof(be)); return 1; } @@ -189,4 +185,3 @@ int gf128_equ_hex(const gf128_t a, const char *s) } return 1; } - diff --git a/src/gf128_arm64.c b/src/gf128_arm64.c index 28df802f..42b0ad67 100644 --- a/src/gf128_arm64.c +++ b/src/gf128_arm64.c @@ -11,7 +11,6 @@ #include #include - = a0 * b0 + ((a0 + a1)*(b0 + b1) - a0*b0 - a1*b1) * x^64 + a1 * b1 * x^128 // this version is converted from the gf128_arm64.S by ChatGPT 4 // a little slower than the asm version