From de5952cae15d8599a8c9044380a6d008d4d3f588 Mon Sep 17 00:00:00 2001 From: Duc Nguyen <106774416+ducnguyen-sb@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:12:14 -0400 Subject: [PATCH] Add secret key object to XMSS (#1530) * Initial addition of sig_stfl API and dummy XMSS variant * add secret key object * allocate and free using wrapper function instead of malloc/free * cleaner function signature * Fix comment * Delete old file * Missing newline * Missing newlines --- src/CMakeLists.txt | 2 + src/sig_stfl/sig_stfl.c | 2 +- src/sig_stfl/sig_stfl.h | 6 +- src/sig_stfl/xmss/external/core_hash.c | 2 +- src/sig_stfl/xmss/sig_stfl_xmss.h | 224 +++++++++--------- src/sig_stfl/xmss/sig_stfl_xmss_sha256_h10.c | 24 +- src/sig_stfl/xmss/sig_stfl_xmss_sha256_h16.c | 26 +- src/sig_stfl/xmss/sig_stfl_xmss_sha256_h20.c | 26 +- src/sig_stfl/xmss/sig_stfl_xmss_sha512_h10.c | 26 +- src/sig_stfl/xmss/sig_stfl_xmss_sha512_h16.c | 26 +- src/sig_stfl/xmss/sig_stfl_xmss_sha512_h20.c | 26 +- .../xmss/sig_stfl_xmss_shake128_h10.c | 26 +- .../xmss/sig_stfl_xmss_shake128_h16.c | 26 +- .../xmss/sig_stfl_xmss_shake128_h20.c | 26 +- .../xmss/sig_stfl_xmss_shake256_h10.c | 26 +- .../xmss/sig_stfl_xmss_shake256_h16.c | 26 +- .../xmss/sig_stfl_xmss_shake256_h20.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h20_2.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h20_4.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h40_2.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h40_4.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h40_8.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h60_12.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h60_3.c | 26 +- .../xmss/sig_stfl_xmssmt_sha256_h60_6.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h20_2.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h20_4.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h40_2.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h40_4.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h40_8.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h60_12.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h60_3.c | 26 +- .../xmss/sig_stfl_xmssmt_shake128_h60_6.c | 26 +- tests/kat_sig_stfl.c | 10 +- tests/test_sig_stfl.c | 21 +- 35 files changed, 493 insertions(+), 500 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3265c12c8a..62aa6039b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,6 +65,8 @@ add_library(oqs kem/kem.c ${SIG_OBJS} sig_stfl/sig_stfl.c ${SIG_STFL_OBJS} + sig_stfl/sig_stfl.c + ${SIG_STFL_OBJS} ${COMMON_OBJS}) set(COMMON_OBJS ${COMMON_OBJS} PARENT_SCOPE) set(_ALL_OBJS ${KEM_OBJS} ${SIG_OBJS} ${COMMON_OBJS} $) diff --git a/src/sig_stfl/sig_stfl.c b/src/sig_stfl/sig_stfl.c index c440e9e95d..c77139e20a 100644 --- a/src/sig_stfl/sig_stfl.c +++ b/src/sig_stfl/sig_stfl.c @@ -438,7 +438,7 @@ OQS_API OQS_STATUS OQS_SIG_STFL_keypair(const OQS_SIG_STFL *sig, uint8_t *public } OQS_API OQS_STATUS OQS_SIG_STFL_sign(const OQS_SIG_STFL *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, - size_t message_len, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key) { if (sig == NULL || sig->sign == NULL || sig->sign(signature, signature_len, message, message_len, secret_key) != 0) { return OQS_ERROR; } else { diff --git a/src/sig_stfl/sig_stfl.h b/src/sig_stfl/sig_stfl.h index 5ef5317376..b795853c5c 100644 --- a/src/sig_stfl/sig_stfl.h +++ b/src/sig_stfl/sig_stfl.h @@ -147,7 +147,7 @@ typedef struct OQS_SIG_STFL { * @param[in] secret_key The secret key represented as a byte string. * @return OQS_SUCCESS or OQS_ERROR */ - OQS_STATUS (*sign)(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const OQS_SIG_STFL_SECRET_KEY *secret_key); + OQS_STATUS (*sign)(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); /** * Signature verification algorithm. @@ -296,7 +296,7 @@ OQS_API OQS_STATUS OQS_SIG_STFL_keypair(const OQS_SIG_STFL *sig, uint8_t *pk, OQ * @param[in] secret_key The secret key represented as a byte string. * @return OQS_SUCCESS or OQS_ERROR */ -OQS_API OQS_STATUS OQS_SIG_STFL_sign(const OQS_SIG_STFL *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_sign(const OQS_SIG_STFL *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); /** * Signature verification algorithm. @@ -315,7 +315,6 @@ OQS_API OQS_STATUS OQS_SIG_STFL_verify(const OQS_SIG_STFL *sig, const uint8_t *m * Query number of remaining signatures * * @param[in] sig The OQS_SIG_STFL object representing the signature scheme. - * @param[out] remain The number of remaining signatures * @param[in] secret_key The secret key represented as a byte string. * @return OQS_SUCCESS or OQS_ERROR */ @@ -334,7 +333,6 @@ OQS_API OQS_STATUS OQS_SIG_STFL_sigs_total(const OQS_SIG_STFL *sig, unsigned lon /** * Frees an OQS_SIG_STFL object that was constructed by OQS_SIG_STFL_new. * - * @param[in] sig The OQS_SIG_STFL object to free. */ OQS_API void OQS_SIG_STFL_free(OQS_SIG_STFL *sig); diff --git a/src/sig_stfl/xmss/external/core_hash.c b/src/sig_stfl/xmss/external/core_hash.c index 565e571e36..b27ad2ca9b 100644 --- a/src/sig_stfl/xmss/external/core_hash.c +++ b/src/sig_stfl/xmss/external/core_hash.c @@ -35,4 +35,4 @@ int core_hash(const xmss_params *params, #endif return 0; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss.h b/src/sig_stfl/xmss/sig_stfl_xmss.h index aa326dfff5..1cf29900f3 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss.h +++ b/src/sig_stfl/xmss/sig_stfl_xmss.h @@ -54,11 +54,11 @@ void OQS_SECRET_KEY_XMSS_free(OQS_SIG_STFL_SECRET_KEY *sk); OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha256_h10_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H10_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -70,11 +70,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_total(unsigned long lon OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha256_h16_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H16_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -86,11 +86,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_total(unsigned long lon OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha256_h20_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H20_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -102,11 +102,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_total(unsigned long lon OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake128_h10_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE128_H10_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -118,11 +118,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_total(unsigned long l OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake128_h16_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE128_H16_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -134,11 +134,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_total(unsigned long l OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake128_h20_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE128_H20_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -150,11 +150,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_total(unsigned long l OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha512_h10_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA512_H10_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -166,11 +166,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_total(unsigned long lon OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha512_h16_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA512_H16_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -182,11 +182,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_total(unsigned long lon OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha512_h20_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA512_H20_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -198,11 +198,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_total(unsigned long lon OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake256_h10_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H10_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -214,11 +214,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_total(unsigned long l OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake256_h16_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H16_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -230,11 +230,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_total(unsigned long l OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake256_h20_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H20_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -246,11 +246,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_total(unsigned long l OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H20_2_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -262,11 +262,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_total(unsigned long OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H20_4_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -278,11 +278,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_total(unsigned long OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H40_2_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -294,11 +294,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_total(unsigned long OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H40_4_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -310,11 +310,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_total(unsigned long OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H40_8_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -326,11 +326,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_total(unsigned long OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H60_3_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -342,11 +342,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_total(unsigned long OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H60_6_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -358,11 +358,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_total(unsigned long OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H60_12_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -374,11 +374,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_total(unsigned lon OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H20_2_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -390,11 +390,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_total(unsigned lo OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H20_4_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -406,11 +406,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_total(unsigned lo OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H40_2_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -422,11 +422,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_total(unsigned lo OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H40_4_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -438,11 +438,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_total(unsigned lo OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H40_8_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -454,11 +454,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_total(unsigned lo OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H60_3_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -470,11 +470,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_total(unsigned lo OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H60_6_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif @@ -486,11 +486,11 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_total(unsigned lo OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_new(void); OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H60_12_new(void); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_keypair(uint8_t *public_key, uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, OQS_SIG_STFL_SECRET_KEY *secret_key); OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key); -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_total(unsigned long long *total, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key); +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key); #endif diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h10.c b/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h10.c index 9a30f7c4f0..4ff8f24e7d 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h10.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h10.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H10_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_sha256_h10_oid = 0x01; - if (xmss_keypair(public_key, secret_key, xmss_sha256_h10_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_sha256_h10_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t)sig_length; @@ -107,24 +107,24 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_verify(XMSS_UNUSED_ATT const return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h16.c b/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h16.c index 289732ecdb..f467b67595 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h16.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h16.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H16_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_sha256_h16_oid = 0x02; - if (xmss_keypair(public_key, secret_key, xmss_sha256_h16_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_sha256_h16_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_verify(XMSS_UNUSED_ATT const return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h20.c b/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h20.c index 936fbdd32a..ab7a74410f 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h20.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_sha256_h20.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H20_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_sha256_h20_oid = 0x03; - if (xmss_keypair(public_key, secret_key, xmss_sha256_h20_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_sha256_h20_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_verify(XMSS_UNUSED_ATT const return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h10.c b/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h10.c index 488713d95a..b38207c86b 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h10.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h10.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA512_H10_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_sha512_h10_oid = 0x04; - if (xmss_keypair(public_key, secret_key, xmss_sha512_h10_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_sha512_h10_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_verify(XMSS_UNUSED_ATT const return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h16.c b/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h16.c index 6993faf83a..050026311a 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h16.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h16.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA512_H16_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_sha512_h16_oid = 0x05; - if (xmss_keypair(public_key, secret_key, xmss_sha512_h16_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_sha512_h16_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_verify(XMSS_UNUSED_ATT const return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h20.c b/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h20.c index 2ebfc9dd57..b5084201fd 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h20.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_sha512_h20.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA512_H20_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_sha512_h20_oid = 0x06; - if (xmss_keypair(public_key, secret_key, xmss_sha512_h20_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_sha512_h20_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_verify(XMSS_UNUSED_ATT const return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha512_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h10.c b/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h10.c index 3e961c076b..ac43b57b3c 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h10.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h10.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE128_H10_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_shake128_h10_oid = 0x07; - if (xmss_keypair(public_key, secret_key, xmss_shake128_h10_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_shake128_h10_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_verify(XMSS_UNUSED_ATT con return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h16.c b/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h16.c index a8ed4fa37e..596939f155 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h16.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h16.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE128_H16_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_shake128_h16_oid = 0x08; - if (xmss_keypair(public_key, secret_key, xmss_shake128_h16_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_shake128_h16_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_verify(XMSS_UNUSED_ATT con return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h20.c b/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h20.c index e39f3912c2..37da02a13b 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h20.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_shake128_h20.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE128_H20_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_shake128_h20_oid = 0x09; - if (xmss_keypair(public_key, secret_key, xmss_shake128_h20_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_shake128_h20_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_verify(XMSS_UNUSED_ATT con return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake128_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h10.c b/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h10.c index 26bd706c9c..f0d27e2033 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h10.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h10.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H10_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_shake256_h10_oid = 0x0a; - if (xmss_keypair(public_key, secret_key, xmss_shake256_h10_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_shake256_h10_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_verify(XMSS_UNUSED_ATT con return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h16.c b/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h16.c index c5c44d6655..38cd5603a9 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h16.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h16.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H16_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_shake256_h16_oid = 0x0b; - if (xmss_keypair(public_key, secret_key, xmss_shake256_h16_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_shake256_h16_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_verify(XMSS_UNUSED_ATT con return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h20.c b/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h20.c index 439f4b3f99..ed1989876e 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h20.c +++ b/src/sig_stfl/xmss/sig_stfl_xmss_shake256_h20.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H20_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmss_shake256_h20_oid = 0x0c; - if (xmss_keypair(public_key, secret_key, xmss_shake256_h20_oid)) { + if (xmss_keypair(public_key, secret_key->secret_key_data, xmss_shake256_h20_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmss_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmss_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_verify(XMSS_UNUSED_ATT con return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_remaining_signatures(remain, secret_key)) { + if (xmss_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmss_total_signatures(total, secret_key)) { + if (xmss_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_2.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_2.c index 4cbd91beb5..792d7a3559 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_2.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_2.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H20_2_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h20_2_oid = 0x01; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h20_2_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h20_2_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_verify(XMSS_UNUSED_ATT c return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_4.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_4.c index 9e830571cd..4a1d1cad52 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_4.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h20_4.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H20_4_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h20_4_oid = 0x02; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h20_4_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h20_4_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_verify(XMSS_UNUSED_ATT c return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h20_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_2.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_2.c index 42181f75f6..9bb9c61445 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_2.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_2.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H40_2_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h40_2_oid = 0x03; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h40_2_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h40_2_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_verify(XMSS_UNUSED_ATT c return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_4.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_4.c index 69df1302f8..64a2da1331 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_4.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_4.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H40_4_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h40_4_oid = 0x04; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h40_4_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h40_4_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_verify(XMSS_UNUSED_ATT c return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_8.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_8.c index 6d4e161d53..13843351ee 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_8.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h40_8.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H40_8_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h40_8_oid = 0x05; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h40_8_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h40_8_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_verify(XMSS_UNUSED_ATT c return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h40_8_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_12.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_12.c index 377518a0da..06873a58db 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_12.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_12.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H60_12_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h60_12_oid = 0x08; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h60_12_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h60_12_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_12_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_3.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_3.c index a455e43814..67183fee79 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_3.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_3.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H60_3_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h60_3_oid = 0x06; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h60_3_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h60_3_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_verify(XMSS_UNUSED_ATT c return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_3_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_6.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_6.c index e57d298615..8ab9134684 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_6.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_sha256_h60_6.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHA256_H60_6_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_sha256_h60_6_oid = 0x07; - if (xmssmt_keypair(public_key, secret_key, xmssmt_sha256_h60_6_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_sha256_h60_6_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_verify(XMSS_UNUSED_ATT c return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_sha256_h60_6_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_2.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_2.c index 331949be1f..279146a010 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_2.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_2.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H20_2_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h20_2_oid = 0x11; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h20_2_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h20_2_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_4.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_4.c index 0acc511e7a..961fd8c0a7 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_4.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h20_4.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H20_4_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h20_4_oid = 0x12; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h20_4_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h20_4_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h20_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_2.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_2.c index cc379336b2..a72d9b7e67 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_2.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_2.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H40_2_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h40_2_oid = 0x13; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h40_2_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h40_2_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_2_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_4.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_4.c index 11030a2494..64c2f8cea3 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_4.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_4.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H40_4_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h40_4_oid = 0x14; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h40_4_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h40_4_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_4_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_8.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_8.c index cec3c1cd73..7b1c137e8a 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_8.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h40_8.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H40_8_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h40_8_oid = 0x15; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h40_8_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h40_8_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h40_8_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_12.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_12.c index 3cb5f20300..41c4317ad9 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_12.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_12.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H60_12_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h60_12_oid = 0x18; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h60_12_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h60_12_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_verify(XMSS_UNUSED_AT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_12_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_3.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_3.c index bc8f7a96bb..5a38219f83 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_3.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_3.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H60_3_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h60_3_oid = 0x16; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h60_3_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h60_3_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_3_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_6.c b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_6.c index 8bcb4dc0dd..9c860051d7 100644 --- a/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_6.c +++ b/src/sig_stfl/xmss/sig_stfl_xmssmt_shake128_h60_6.c @@ -65,28 +65,28 @@ OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSSMT_SHAKE128_H60_6_new(void) { return sk; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_keypair(XMSS_UNUSED_ATT uint8_t *public_key, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (public_key == NULL || secret_key == NULL) { + if (public_key == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } const uint32_t xmssmt_shake128_h60_6_oid = 0x17; - if (xmssmt_keypair(public_key, secret_key, xmssmt_shake128_h60_6_oid)) { + if (xmssmt_keypair(public_key, secret_key->secret_key_data, xmssmt_shake128_h60_6_oid)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sign(uint8_t *signature, size_t *signature_len, XMSS_UNUSED_ATT const uint8_t *message, XMSS_UNUSED_ATT size_t message_len, XMSS_UNUSED_ATT OQS_SIG_STFL_SECRET_KEY *secret_key) { - if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL) { + if (signature == NULL || signature_len == NULL || message == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } unsigned long long sig_length = 0; - if (xmssmt_sign(secret_key, signature, &sig_length, message, message_len)) { + if (xmssmt_sign(secret_key->secret_key_data, signature, &sig_length, message, message_len)) { return OQS_ERROR; } *signature_len = (size_t) sig_length; @@ -107,26 +107,26 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_verify(XMSS_UNUSED_ATT return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_remaining(unsigned long long *remain, const uint8_t *secret_key) { - if (remain == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_remaining(unsigned long long *remain, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (remain == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_remaining_signatures(remain, secret_key)) { + if (xmssmt_remaining_signatures(remain, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; } -OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_total(unsigned long long *total, const uint8_t *secret_key) { - if (total == NULL || secret_key == NULL) { +OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmssmt_shake128_h60_6_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key) { + if (total == NULL || secret_key == NULL || secret_key->secret_key_data == NULL) { return OQS_ERROR; } - if (xmssmt_total_signatures(total, secret_key)) { + if (xmssmt_total_signatures(total, secret_key->secret_key_data)) { return OQS_ERROR; } return OQS_SUCCESS; -} \ No newline at end of file +} diff --git a/tests/kat_sig_stfl.c b/tests/kat_sig_stfl.c index a2b2e51e87..ebb89c14e8 100644 --- a/tests/kat_sig_stfl.c +++ b/tests/kat_sig_stfl.c @@ -141,7 +141,7 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) { uint8_t *msg = NULL, *msg_rand = NULL; size_t msg_len = 0; uint8_t *public_key = NULL; - uint8_t *secret_key = NULL; + OQS_SIG_STFL_SECRET_KEY *secret_key = NULL; uint8_t *signature = NULL, *signature_kat = NULL; uint8_t *signed_msg = NULL; size_t signature_len = 0; @@ -168,7 +168,7 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) { // Grab the pk and sk from KAT file public_key = malloc(sig->length_public_key); - secret_key = calloc(sig->length_secret_key, sizeof(uint8_t)); + secret_key = OQS_SIG_STFL_SECRET_KEY_new(sig->method_name); signature = calloc(sig->length_signature, sizeof(uint8_t)); signature_kat = calloc(sig->length_signature, sizeof(uint8_t)); @@ -182,7 +182,7 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) { goto err; } - if (!ReadHex(fp_rsp, secret_key, sig->length_secret_key, "sk = ")) { + if (!ReadHex(fp_rsp, secret_key->secret_key_data, sig->length_secret_key, "sk = ")) { fprintf(stderr, "ERROR: unable to read 'sk' from <%s>\n", katfile); goto err; } @@ -191,7 +191,7 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) { fprintf(fh, "# %s\n\n", sig->method_name); fprintBstr(fh, "pk = ", public_key, sig->length_public_key); - fprintBstr(fh, "sk = ", secret_key, sig->length_secret_key); + fprintBstr(fh, "sk = ", secret_key->secret_key_data, sig->length_secret_key); fprintf(fh, "\n\n"); fprintf(fh, "count = 0\n"); @@ -280,10 +280,10 @@ OQS_STATUS sig_stfl_kat(const char *method_name, const char *katfile) { cleanup: if (sig != NULL) { - OQS_MEM_secure_free(secret_key, sig->length_secret_key); OQS_MEM_secure_free(signed_msg, signed_msg_len); } OQS_MEM_insecure_free(public_key); + OQS_SIG_STFL_SECRET_KEY_free(secret_key); OQS_MEM_insecure_free(signature); OQS_MEM_insecure_free(signature_kat); OQS_MEM_insecure_free(msg); diff --git a/tests/test_sig_stfl.c b/tests/test_sig_stfl.c index a393dc6cf4..770eb58f82 100644 --- a/tests/test_sig_stfl.c +++ b/tests/test_sig_stfl.c @@ -123,7 +123,7 @@ int ReadHex(FILE *infile, unsigned char *a, unsigned long Length, char *str) { return 1; } -OQS_STATUS sig_stfl_keypair_from_keygen(OQS_SIG_STFL *sig, uint8_t *public_key, uint8_t *secret_key) { +OQS_STATUS sig_stfl_keypair_from_keygen(OQS_SIG_STFL *sig, uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key) { OQS_STATUS rc; rc = OQS_SIG_STFL_keypair(sig, public_key, secret_key); OQS_TEST_CT_DECLASSIFY(&rc, sizeof rc); @@ -133,7 +133,7 @@ OQS_STATUS sig_stfl_keypair_from_keygen(OQS_SIG_STFL *sig, uint8_t *public_key, return OQS_SUCCESS; } -OQS_STATUS sig_stfl_keypair_from_KATs(OQS_SIG_STFL *sig, uint8_t *public_key, uint8_t *secret_key, const char *katfile) { +OQS_STATUS sig_stfl_keypair_from_KATs(OQS_SIG_STFL *sig, uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key, const char *katfile) { OQS_STATUS ret = OQS_ERROR; FILE *fp_rsp = NULL; @@ -148,7 +148,7 @@ OQS_STATUS sig_stfl_keypair_from_KATs(OQS_SIG_STFL *sig, uint8_t *public_key, ui goto err; } - if (!ReadHex(fp_rsp, secret_key, sig->length_secret_key, "sk = ")) { + if (!ReadHex(fp_rsp, secret_key->secret_key_data, sig->length_secret_key, "sk = ")) { fprintf(stderr, "ERROR: unable to read 'sk' from <%s>\n", katfile); goto err; } @@ -176,7 +176,7 @@ OQS_STATUS sig_stfl_keypair_from_KATs(OQS_SIG_STFL *sig, uint8_t *public_key, ui * XMSSMT-SHAKE_40/2_256 * XMSSMT-SHAKE_60/3_256 */ -OQS_STATUS sig_stfl_KATs_keygen(OQS_SIG_STFL *sig, uint8_t *public_key, uint8_t *secret_key, const char *katfile) { +OQS_STATUS sig_stfl_KATs_keygen(OQS_SIG_STFL *sig, uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key, const char *katfile) { printf("%s", sig->method_name); if (0) { @@ -253,7 +253,7 @@ static OQS_STATUS sig_stfl_test_correctness(const char *method_name, const char OQS_SIG_STFL *sig = NULL; uint8_t *public_key = NULL; - uint8_t *secret_key = NULL; + OQS_SIG_STFL_SECRET_KEY *secret_key = NULL; uint8_t *message = NULL; size_t message_len = 100; uint8_t *signature = NULL; @@ -275,8 +275,8 @@ static OQS_STATUS sig_stfl_test_correctness(const char *method_name, const char printf("Sample computation for stateful signature %s\n", sig->method_name); printf("================================================================================\n"); + secret_key = OQS_SIG_STFL_SECRET_KEY_new(sig->method_name); public_key = malloc(sig->length_public_key + 2 * sizeof(magic_t)); - secret_key = malloc(sig->length_secret_key + 2 * sizeof(magic_t)); message = malloc(message_len + 2 * sizeof(magic_t)); signature = malloc(sig->length_signature + 2 * sizeof(magic_t)); @@ -287,18 +287,15 @@ static OQS_STATUS sig_stfl_test_correctness(const char *method_name, const char //Set the magic numbers before memcpy(public_key, magic.val, sizeof(magic_t)); - memcpy(secret_key, magic.val, sizeof(magic_t)); memcpy(message, magic.val, sizeof(magic_t)); memcpy(signature, magic.val, sizeof(magic_t)); public_key += sizeof(magic_t); - secret_key += sizeof(magic_t); message += sizeof(magic_t); signature += sizeof(magic_t); // and after memcpy(public_key + sig->length_public_key, magic.val, sizeof(magic_t)); - memcpy(secret_key + sig->length_secret_key, magic.val, sizeof(magic_t)); memcpy(message + message_len, magic.val, sizeof(magic_t)); memcpy(signature + sig->length_signature, magic.val, sizeof(magic_t)); @@ -344,11 +341,9 @@ static OQS_STATUS sig_stfl_test_correctness(const char *method_name, const char #ifndef OQS_ENABLE_TEST_CONSTANT_TIME /* check magic values */ int rv = memcmp(public_key + sig->length_public_key, magic.val, sizeof(magic_t)); - rv |= memcmp(secret_key + sig->length_secret_key, magic.val, sizeof(magic_t)); rv |= memcmp(message + message_len, magic.val, sizeof(magic_t)); rv |= memcmp(signature + sig->length_signature, magic.val, sizeof(magic_t)); rv |= memcmp(public_key - sizeof(magic_t), magic.val, sizeof(magic_t)); - rv |= memcmp(secret_key - sizeof(magic_t), magic.val, sizeof(magic_t)); rv |= memcmp(message - sizeof(magic_t), magic.val, sizeof(magic_t)); rv |= memcmp(signature - sizeof(magic_t), magic.val, sizeof(magic_t)); if (rv) { @@ -365,9 +360,7 @@ static OQS_STATUS sig_stfl_test_correctness(const char *method_name, const char ret = OQS_ERROR; cleanup: - if (secret_key) { - OQS_MEM_secure_free(secret_key - sizeof(magic_t), sig->length_secret_key + 2 * sizeof(magic_t)); - } + OQS_SIG_STFL_SECRET_KEY_free(secret_key); if (public_key) { OQS_MEM_insecure_free(public_key - sizeof(magic_t)); }