Skip to content

Commit

Permalink
add XMSS-SHA2_*_192 parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Duc Tri Nguyen <[email protected]>
  • Loading branch information
cothan committed Jun 12, 2024
1 parent 6ee5de2 commit 2db0ed1
Show file tree
Hide file tree
Showing 14 changed files with 241 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .CMake/alg_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_sha512_h20 "" ON "OQS_ENABLE_SIG
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h10 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h16 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h20 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_4 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmssmt_sha256_h40_2 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
Expand Down
4 changes: 4 additions & 0 deletions src/oqsconfig.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h10 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h16 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h20 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192 1

#cmakedefine OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_4 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmssmt_sha256_h40_2 1
Expand Down
57 changes: 57 additions & 0 deletions src/sig_stfl/sig_stfl.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ OQS_API const char *OQS_SIG_STFL_alg_identifier(size_t i) {
OQS_SIG_STFL_alg_xmss_shake256_h10,
OQS_SIG_STFL_alg_xmss_shake256_h16,
OQS_SIG_STFL_alg_xmss_shake256_h20,
OQS_SIG_STFL_alg_xmss_sha256_h10_192,
OQS_SIG_STFL_alg_xmss_sha256_h16_192,
OQS_SIG_STFL_alg_xmss_sha256_h20_192,
OQS_SIG_STFL_alg_xmssmt_sha256_h20_2,
OQS_SIG_STFL_alg_xmssmt_sha256_h20_4,
OQS_SIG_STFL_alg_xmssmt_sha256_h40_2,
Expand Down Expand Up @@ -183,6 +186,24 @@ OQS_API int OQS_SIG_STFL_alg_is_enabled(const char *method_name) {
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h10_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h16_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h20_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmssmt_sha256_h20_2)) {
#ifdef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2
Expand Down Expand Up @@ -571,6 +592,24 @@ OQS_API OQS_SIG_STFL *OQS_SIG_STFL_new(const char *method_name) {
return OQS_SIG_STFL_alg_xmss_shake256_h20_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h10_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192
return OQS_SIG_STFL_alg_xmss_sha256_h10_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h16_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192
return OQS_SIG_STFL_alg_xmss_sha256_h16_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h20_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192
return OQS_SIG_STFL_alg_xmss_sha256_h20_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmssmt_sha256_h20_2)) {
#ifdef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2
Expand Down Expand Up @@ -1032,6 +1071,24 @@ OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SIG_STFL_SECRET_KEY_new(const char *method_
return OQS_SECRET_KEY_XMSS_SHAKE256_H20_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h10_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192
return OQS_SECRET_KEY_XMSS_SHA256_H10_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h16_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192
return OQS_SECRET_KEY_XMSS_SHA256_H16_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_sha256_h20_192)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192
return OQS_SECRET_KEY_XMSS_SHA256_H20_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmssmt_sha256_h20_2)) {
#ifdef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2
Expand Down
6 changes: 5 additions & 1 deletion src/sig_stfl/sig_stfl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ extern "C"
#define OQS_SIG_STFL_alg_xmss_shake256_h10 "XMSS-SHAKE_10_512"
#define OQS_SIG_STFL_alg_xmss_shake256_h16 "XMSS-SHAKE_16_512"
#define OQS_SIG_STFL_alg_xmss_shake256_h20 "XMSS-SHAKE_20_512"
#define OQS_SIG_STFL_alg_xmss_sha256_h10_192 "XMSS-SHA2_10_192"
#define OQS_SIG_STFL_alg_xmss_sha256_h16_192 "XMSS-SHA2_16_192"
#define OQS_SIG_STFL_alg_xmss_sha256_h20_192 "XMSS-SHA2_20_192"

#define OQS_SIG_STFL_alg_xmssmt_sha256_h20_2 "XMSSMT-SHA2_20/2_256"
#define OQS_SIG_STFL_alg_xmssmt_sha256_h20_4 "XMSSMT-SHA2_20/4_256"
#define OQS_SIG_STFL_alg_xmssmt_sha256_h40_2 "XMSSMT-SHA2_40/2_256"
Expand Down Expand Up @@ -122,7 +126,7 @@ extern "C"
/*
* Total number of stateful variants defined above, used to create the tracking array
*/
#define OQS_SIG_STFL_algs_length 61
#define OQS_SIG_STFL_algs_length 64

typedef struct OQS_SIG_STFL_SECRET_KEY OQS_SIG_STFL_SECRET_KEY;

Expand Down
18 changes: 18 additions & 0 deletions src/sig_stfl/xmss/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ if (OQS_ENABLE_SIG_STFL_xmss_shake256_h20)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_shake256_h20>)
endif()

if (OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192)
add_library(xmss_sha256_h10_192 OBJECT sig_stfl_xmss_sha256_h10_192.c sig_stfl_xmss_functions.c ${SRCS})
target_compile_options(xmss_sha256_h10_192 PRIVATE -DXMSS_PARAMS_NAMESPACE=xmss_sha256_h10_192 -DHASH=1)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_sha256_h10_192>)
endif()

if (OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192)
add_library(xmss_sha256_h16_192 OBJECT sig_stfl_xmss_sha256_h16_192.c sig_stfl_xmss_functions.c ${SRCS})
target_compile_options(xmss_sha256_h16_192 PRIVATE -DXMSS_PARAMS_NAMESPACE=xmss_sha256_h16_192 -DHASH=1)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_sha256_h16_192>)
endif()

if (OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192)
add_library(xmss_sha256_h20_192 OBJECT sig_stfl_xmss_sha256_h20_192.c sig_stfl_xmss_functions.c ${SRCS})
target_compile_options(xmss_sha256_h20_192 PRIVATE -DXMSS_PARAMS_NAMESPACE=xmss_sha256_h20_192 -DHASH=1)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_sha256_h20_192>)
endif()

if (OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2)
add_library(xmssmt_sha256_h20_2 OBJECT sig_stfl_xmssmt_sha256_h20_2.c sig_stfl_xmssmt_functions.c ${SRCS})
target_compile_options(xmssmt_sha256_h20_2 PRIVATE -DXMSS_PARAMS_NAMESPACE=xmssmt_sha256_h20_2 -DHASH=3)
Expand Down
115 changes: 85 additions & 30 deletions src/sig_stfl/xmss/sig_stfl_xmss.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,45 @@
#define XMSS_OID_LEN 4

/*
* | Algorithms | oid | sk (b) | pk (b) | sig (b) | n |
* |-------------------------------|------|--------|--------|---------|----|
* | XMSS-SHA2_10_256 | 0x01 | 1373 | 64 | 2500 | 32 |
* | XMSS-SHA2_16_256 | 0x02 | 2093 | 64 | 2692 | 32 |
* | XMSS-SHA2_20_256 | 0x03 | 2573 | 64 | 2820 | 32 |
* | Algorithms | oid | sk (b) | pk (b) | sig (b) | n | RFC8391 | NIST SP 800-208 | CNSA 2.0 |
* |-------------------------------|------|--------|--------|---------|----| ------- | --------------- | -------- |
* | XMSS-SHA2_10_256 | 0x01 | 1373 | 64 | 2500 | 32 | ✅ | ✅ | ✅ |
* | XMSS-SHA2_16_256 | 0x02 | 2093 | 64 | 2692 | 32 | ✅ | ✅ | ✅ |
* | XMSS-SHA2_20_256 | 0x03 | 2573 | 64 | 2820 | 32 | ✅ | ✅ | ✅ |
*
* | XMSS-SHAKE_10_256 | 0x07 | 1373 | 64 | 2500 | 32 |
* | XMSS-SHAKE_16_256 | 0x08 | 2093 | 64 | 2692 | 32 |
* | XMSS-SHAKE_20_256 | 0x09 | 2573 | 64 | 2820 | 32 |
* | XMSS-SHAKE_10_256 | 0x07 | 1373 | 64 | 2500 | 32 | ✅ | ❌ | ❌ |
* | XMSS-SHAKE_16_256 | 0x08 | 2093 | 64 | 2692 | 32 | ✅ | ❌ | ❌ |
* | XMSS-SHAKE_20_256 | 0x09 | 2573 | 64 | 2820 | 32 | ✅ | ❌ | ❌ |
*
* | XMSS-SHA2_10_512 | 0x04 | 2653 | 128 | 9092 | 64 |
* | XMSS-SHA2_16_512 | 0x05 | 4045 | 128 | 9476 | 64 |
* | XMSS-SHA2_20_512 | 0x06 | 4973 | 128 | 9732 | 64 |
* | XMSS-SHA2_10_512 | 0x04 | 2653 | 128 | 9092 | 64 | ✅ | ❌ | ❌ |
* | XMSS-SHA2_16_512 | 0x05 | 4045 | 128 | 9476 | 64 | ✅ | ❌ | ❌ |
* | XMSS-SHA2_20_512 | 0x06 | 4973 | 128 | 9732 | 64 | ✅ | ❌ | ❌ |
*
* | XMSS-SHAKE_10_512 | 0x0a | 2653 | 128 | 9092 | 64 |
* | XMSS-SHAKE_16_512 | 0x0b | 4045 | 128 | 9476 | 64 |
* | XMSS-SHAKE_20_512 | 0x0c | 4973 | 128 | 9732 | 64 |
* | XMSS-SHAKE_10_512 | 0x0a | 2653 | 128 | 9092 | 64 | ✅ | ❌ | ❌ |
* | XMSS-SHAKE_16_512 | 0x0b | 4045 | 128 | 9476 | 64 | ✅ | ❌ | ❌ |
* | XMSS-SHAKE_20_512 | 0x0c | 4973 | 128 | 9732 | 64 | ✅ | ❌ | ❌ |
*
* | XMSSMT-SHA2_20/2_256 | 0x01 | 5998 | 64 | 4963 | 32 |
* | XMSSMT-SHA2_20/4_256 | 0x02 | 10938 | 64 | 9251 | 32 |
* | XMSSMT-SHA2_40/2_256 | 0x03 | 9600 | 64 | 5605 | 32 |
* | XMSSMT-SHA2_40/4_256 | 0x04 | 15252 | 64 | 9893 | 32 |
* | XMSSMT-SHA2_40/8_256 | 0x05 | 24516 | 64 | 18469 | 32 |
* | XMSSMT-SHA2_60/3_256 | 0x06 | 16629 | 64 | 8392 | 32 |
* | XMSSMT-SHA2_60/6_256 | 0x07 | 24507 | 64 | 14824 | 32 |
* | XMSSMT-SHA2_60/12_256 | 0x08 | 38095 | 64 | 27688 | 32 |
* | XMSS-SHA2_10_192 | 0x0d | 1053 | 48 | 1492 | 24 | ❌ | ✅ | ✅ |
* | XMSS-SHA2_16_192 | 0x0e | 1605 | 48 | 1636 | 24 | ❌ | ✅ | ✅ |
* | XMSS-SHA2_20_192 | 0x0f | 1973 | 48 | 1732 | 24 | ❌ | ✅ | ✅ |
*
* | XMSSMT-SHAKE_20/2_256 | 0x11 | 5998 | 64 | 4963 | 32 |
* | XMSSMT-SHAKE_20/4_256 | 0x12 | 10938 | 64 | 9251 | 32 |
* | XMSSMT-SHAKE_40/2_256 | 0x13 | 9600 | 64 | 5605 | 32 |
* | XMSSMT-SHAKE_40/4_256 | 0x14 | 15252 | 64 | 9893 | 32 |
* | XMSSMT-SHAKE_40/8_256 | 0x15 | 24516 | 64 | 18469 | 32 |
* | XMSSMT-SHAKE_60/3_256 | 0x16 | 16629 | 64 | 8392 | 32 |
* | XMSSMT-SHAKE_60/6_256 | 0x17 | 24507 | 64 | 14824 | 32 |
* | XMSSMT-SHAKE_60/12_256 | 0x18 | 38095 | 64 | 27688 | 32 |
* | XMSSMT-SHA2_20/2_256 | 0x01 | 5998 | 64 | 4963 | 32 | ✅ | ✅ | ❌ |
* | XMSSMT-SHA2_20/4_256 | 0x02 | 10938 | 64 | 9251 | 32 | ✅ | ✅ | ❌ |
* | XMSSMT-SHA2_40/2_256 | 0x03 | 9600 | 64 | 5605 | 32 | ✅ | ✅ | ❌ |
* | XMSSMT-SHA2_40/4_256 | 0x04 | 15252 | 64 | 9893 | 32 | ✅ | ✅ | ❌ |
* | XMSSMT-SHA2_40/8_256 | 0x05 | 24516 | 64 | 18469 | 32 | ✅ | ✅ | ❌ |
* | XMSSMT-SHA2_60/3_256 | 0x06 | 16629 | 64 | 8392 | 32 | ✅ | ✅ | ❌ |
* | XMSSMT-SHA2_60/6_256 | 0x07 | 24507 | 64 | 14824 | 32 | ✅ | ✅ | ❌ |
* | XMSSMT-SHA2_60/12_256 | 0x08 | 38095 | 64 | 27688 | 32 | ✅ | ✅ | ❌ |
*
* | XMSSMT-SHAKE_20/2_256 | 0x11 | 5998 | 64 | 4963 | 32 | ✅ | ❌ | ❌ |
* | XMSSMT-SHAKE_20/4_256 | 0x12 | 10938 | 64 | 9251 | 32 | ✅ | ❌ | ❌ |
* | XMSSMT-SHAKE_40/2_256 | 0x13 | 9600 | 64 | 5605 | 32 | ✅ | ❌ | ❌ |
* | XMSSMT-SHAKE_40/4_256 | 0x14 | 15252 | 64 | 9893 | 32 | ✅ | ❌ | ❌ |
* | XMSSMT-SHAKE_40/8_256 | 0x15 | 24516 | 64 | 18469 | 32 | ✅ | ❌ | ❌ |
* | XMSSMT-SHAKE_60/3_256 | 0x16 | 16629 | 64 | 8392 | 32 | ✅ | ❌ | ❌ |
* | XMSSMT-SHAKE_60/6_256 | 0x17 | 24507 | 64 | 14824 | 32 | ✅ | ❌ | ❌ |
* | XMSSMT-SHAKE_60/12_256 | 0x18 | 38095 | 64 | 27688 | 32 | ✅ | ❌ | ❌ |
*/

#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h10
Expand Down Expand Up @@ -254,6 +258,57 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_sigs_total(unsigned long l

#endif

#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h10_192

#define OQS_SIG_STFL_alg_xmss_sha256_h10_192_oid 0x0d
#define OQS_SIG_STFL_alg_xmss_sha256_h10_192_length_sk (1053 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_sha256_h10_192_length_pk (48 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_sha256_h10_192_length_signature 1492

OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha256_h10_192_new(void);
OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H10_192_new(void);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_192_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h10_192_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_192_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_192_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_192_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key);

#endif

#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h16_192

#define OQS_SIG_STFL_alg_xmss_sha256_h16_192_oid 0x0e
#define OQS_SIG_STFL_alg_xmss_sha256_h16_192_length_sk (1605 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_sha256_h16_192_length_pk (48 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_sha256_h16_192_length_signature 1636

OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha256_h16_192_new(void);
OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H16_192_new(void);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_192_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h16_192_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_192_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_192_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_192_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key);

#endif

#ifdef OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192

#define OQS_SIG_STFL_alg_xmss_sha256_h20_192_oid 0x0f
#define OQS_SIG_STFL_alg_xmss_sha256_h20_192_length_sk (1973 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_sha256_h20_192_length_pk (48 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_sha256_h20_192_length_signature 1732

OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_sha256_h20_192_new(void);
OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHA256_H20_192_new(void);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_192_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_sha256_h20_192_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_192_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_192_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_192_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key);

#endif

#ifdef OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2

#define OQS_SIG_STFL_alg_xmssmt_sha256_h20_2_oid 0x01
Expand Down
7 changes: 7 additions & 0 deletions src/sig_stfl/xmss/sig_stfl_xmss_sha256_h10_192.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: (Apache-2.0 OR MIT) AND CC0-1.0

#include "sig_stfl_xmss_xmssmt.c"

// ======================== XMSS-SHA2_10_192 ======================== //

XMSS_ALG(, _sha256_h10_192, _SHA256_H10_192)
7 changes: 7 additions & 0 deletions src/sig_stfl/xmss/sig_stfl_xmss_sha256_h16_192.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: (Apache-2.0 OR MIT) AND CC0-1.0

#include "sig_stfl_xmss_xmssmt.c"

// ======================== XMSS-SHA2_16_192 ======================== //

XMSS_ALG(, _sha256_h16_192, _SHA256_H16_192)
7 changes: 7 additions & 0 deletions src/sig_stfl/xmss/sig_stfl_xmss_sha256_h20_192.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: (Apache-2.0 OR MIT) AND CC0-1.0

#include "sig_stfl_xmss_xmssmt.c"

// ======================== XMSS-SHA2_20_192 ======================== //

XMSS_ALG(, _sha256_h20_192, _SHA256_H20_192)
3 changes: 3 additions & 0 deletions tests/KATs/sig_stfl/kats.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"XMSS-SHAKE_10_512": "8142c58d407dab3f39f1142e253fff535c572d5adcb4fd21b51a62eef33453d8",
"XMSS-SHAKE_16_512": "29150754aad6d8150e86f58224f72521d76d5bfba43d5f54791c1d5def27a205",
"XMSS-SHAKE_20_512": "fbe74ab00eb150f63b9da9ddd325b667e55a65bb994434ccf2c7b670e7e22406",
"XMSS-SHA2_10_192": "6efee401869dafee754165a22a6f2f3b467fbaaa4f054bad5b70c7f4c5857133",
"XMSS-SHA2_16_192": "33225885b04da07a95ea63f993d05ee50223d3484f537f324b290d8a317d7bd7",
"XMSS-SHA2_20_192": "cf30df53ca187aabe92d5915e4fd26a118cca1f20af1002f96b63614d04e973b",
"XMSSMT-SHA2_20/2_256": "9f117294999c886ac6b69d6f32c3fc152599343add210f4464aee5d1ca0ec34d",
"XMSSMT-SHA2_20/4_256": "0c990e8ff8189140e8539b11ae3f85040544fc7d549f8db17d83392569647de9",
"XMSSMT-SHA2_40/2_256": "91605c4b67afb4e17d57ed076e10d3c4287264deea4a46092e374199c041d489",
Expand Down
Loading

0 comments on commit 2db0ed1

Please sign in to comment.