From e177d16ec95c92eeb3e6a3a1803a6174e0206d59 Mon Sep 17 00:00:00 2001 From: Songling Han Date: Sat, 21 Sep 2024 07:20:40 +0000 Subject: [PATCH] sig_stfl build fix Signed-off-by: Songling Han --- src/sig_stfl/lms/CMakeLists.txt | 1 + src/sig_stfl/lms/external/common_defs.h | 2 +- src/sig_stfl/xmss/external/wots.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sig_stfl/lms/CMakeLists.txt b/src/sig_stfl/lms/CMakeLists.txt index e47452eb50..b04030e834 100644 --- a/src/sig_stfl/lms/CMakeLists.txt +++ b/src/sig_stfl/lms/CMakeLists.txt @@ -37,6 +37,7 @@ set(SRCS add_library(lms OBJECT ${SRCS}) +target_include_directories(lms PRIVATE ${LIBOQS_ROOT_DIR}/include) set(_LMS_OBJS ${_LMS_OBJS} $) set(LMS_OBJS ${_LMS_OBJS} PARENT_SCOPE) diff --git a/src/sig_stfl/lms/external/common_defs.h b/src/sig_stfl/lms/external/common_defs.h index 1c7c85d382..2a64738102 100644 --- a/src/sig_stfl/lms/external/common_defs.h +++ b/src/sig_stfl/lms/external/common_defs.h @@ -9,7 +9,7 @@ #include #include - +#include #define MAX_HASH 32 /* Length of the largest hash we support */ /* The I (Merkle tree identifier) value is 16 bytes long */ diff --git a/src/sig_stfl/xmss/external/wots.c b/src/sig_stfl/xmss/external/wots.c index 6ba8dd9f9e..3d87c206b2 100644 --- a/src/sig_stfl/xmss/external/wots.c +++ b/src/sig_stfl/xmss/external/wots.c @@ -187,7 +187,7 @@ void wots_pk_from_sig(const xmss_params *params, unsigned char *pk, const unsigned char *sig, const unsigned char *msg, const unsigned char *pub_seed, uint32_t addr[8]) { - unsigned int *lengths = OQS_MEM_malloc(params->wots_len, sizeof(unsigned int )); + unsigned int *lengths = OQS_MEM_calloc(params->wots_len, sizeof(unsigned int )); const size_t thash_buf_len = 2 * params->padding_len + 4 * params->n + 32; unsigned char *thash_buf = OQS_MEM_malloc(thash_buf_len); unsigned int i;