Skip to content

Commit

Permalink
Add XMSS-SHAKE256_{10, 16, 20}_256 parameters (#1819)
Browse files Browse the repository at this point in the history
* add XMSS-SHAKE256_*_256 parameters

Signed-off-by: Duc Tri Nguyen <[email protected]>

* [trigger downstream]

Signed-off-by: Duc Tri Nguyen <[email protected]>

---------

Signed-off-by: Duc Tri Nguyen <[email protected]>
  • Loading branch information
cothan authored Jun 25, 2024
1 parent e3f05cb commit 51ddd33
Show file tree
Hide file tree
Showing 17 changed files with 231 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .CMake/alg_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_sha256_h20_192 "" ON "OQS_ENABLE
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h10_192 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h16_192 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h20_192 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256 "" ON "OQS_ENABLE_SIG_STFL_XMSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256 "" 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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ All names other than `ML-KEM` and `ML-DSA` are subject to change. `liboqs` makes
- **SPHINCS+-SHA2**: SPHINCS+-SHA2-128f-simple, SPHINCS+-SHA2-128s-simple, SPHINCS+-SHA2-192f-simple, SPHINCS+-SHA2-192s-simple, SPHINCS+-SHA2-256f-simple, SPHINCS+-SHA2-256s-simple
- **SPHINCS+-SHAKE**: SPHINCS+-SHAKE-128f-simple, SPHINCS+-SHAKE-128s-simple, SPHINCS+-SHAKE-192f-simple, SPHINCS+-SHAKE-192s-simple, SPHINCS+-SHAKE-256f-simple, SPHINCS+-SHAKE-256s-simple
<!--- OQS_TEMPLATE_FRAGMENT_LIST_SIGS_END -->
- **XMSS**: XMSS-SHA2_10_256, XMSS-SHA2_16_256, XMSS-SHA2_20_256, XMSS-SHAKE_10_256, XMSS-SHAKE_16_256, XMSS-SHAKE_20_256, XMSS-SHA2_10_512, XMSS-SHA2_16_512, XMSS-SHA2_20_512, XMSS-SHAKE_10_512, XMSS-SHAKE_16_512, XMSS-SHAKE_20_512, XMSS-SHA2_10_192, XMSS-SHA2_16_192, XMSS-SHA2_20_192, XMSS-SHAKE256_10_192, XMSS-SHAKE256_16_192, XMSS-SHAKE256_20_192, XMSSMT-SHA2_20/2_256, XMSSMT-SHA2_20/4_256, XMSSMT-SHA2_40/2_256, XMSSMT-SHA2_40/4_256, XMSSMT-SHA2_40/8_256, XMSSMT-SHA2_60/3_256, XMSSMT-SHA2_60/6_256, XMSSMT-SHA2_60/12_256, XMSSMT-SHAKE_20/2_256, XMSSMT-SHAKE_20/4_256, XMSSMT-SHAKE_40/2_256, XMSSMT-SHAKE_40/4_256, XMSSMT-SHAKE_40/8_256, XMSSMT-SHAKE_60/3_256, XMSSMT-SHAKE_60/6_256, XMSSMT-SHAKE_60/12_256
- **XMSS**: XMSS-SHA2_10_256, XMSS-SHA2_16_256, XMSS-SHA2_20_256, XMSS-SHAKE_10_256, XMSS-SHAKE_16_256, XMSS-SHAKE_20_256, XMSS-SHA2_10_512, XMSS-SHA2_16_512, XMSS-SHA2_20_512, XMSS-SHAKE_10_512, XMSS-SHAKE_16_512, XMSS-SHAKE_20_512, XMSS-SHA2_10_192, XMSS-SHA2_16_192, XMSS-SHA2_20_192, XMSS-SHAKE256_10_192, XMSS-SHAKE256_16_192, XMSS-SHAKE256_20_192, SHAKE256_10_256, SHAKE256_16_256, SHAKE256_20_256, XMSSMT-SHA2_20/2_256, XMSSMT-SHA2_20/4_256, XMSSMT-SHA2_40/2_256, XMSSMT-SHA2_40/4_256, XMSSMT-SHA2_40/8_256, XMSSMT-SHA2_60/3_256, XMSSMT-SHA2_60/6_256, XMSSMT-SHA2_60/12_256, XMSSMT-SHAKE_20/2_256, XMSSMT-SHAKE_20/4_256, XMSSMT-SHAKE_40/2_256, XMSSMT-SHAKE_40/4_256, XMSSMT-SHAKE_40/8_256, XMSSMT-SHAKE_60/3_256, XMSSMT-SHAKE_60/6_256, XMSSMT-SHAKE_60/12_256
- **LMS**: LMS_SHA256_H5_W1, LMS_SHA256_H5_W2, LMS_SHA256_H5_W4, LMS_SHA256_H5_W8, LMS_SHA256_H10_W1, LMS_SHA256_H10_W2, LMS_SHA256_H10_W4, LMS_SHA256_H10_W8, LMS_SHA256_H15_W1, LMS_SHA256_H15_W2, LMS_SHA256_H15_W4, LMS_SHA256_H15_W8, LMS_SHA256_H20_W1, LMS_SHA256_H20_W2, LMS_SHA256_H20_W4, LMS_SHA256_H20_W8, LMS_SHA256_H25_W1, LMS_SHA256_H25_W2, LMS_SHA256_H25_W4, LMS_SHA256_H25_W8, LMS_SHA256_H5_W8_H5_W8, LMS_SHA256_H10_W4_H5_W8, LMS_SHA256_H10_W8_H5_W8, LMS_SHA256_H10_W2_H10_W2, LMS_SHA256_H10_W4_H10_W4, LMS_SHA256_H10_W8_H10_W8, LMS_SHA256_H15_W8_H5_W8, LMS_SHA256_H15_W8_H10_W8, LMS_SHA256_H15_W8_H15_W8, LMS_SHA256_H20_W8_H5_W8, LMS_SHA256_H20_W8_H10_W8, LMS_SHA256_H20_W8_H15_W8, LMS_SHA256_H20_W8_H20_W8

Note that for algorithms marked with a dagger (†), liboqs contains at least one implementation that uses a large amount of stack space; this may cause failures when run in threads or in constrained environments. For more information, consult the algorithm information sheets in the [docs/algorithms](https://github.com/open-quantum-safe/liboqs/tree/main/docs/algorithms) folder.
Expand Down
3 changes: 3 additions & 0 deletions docs/algorithms/sig_stfl/xmss.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
| XMSS-SHAKE256_10_192 | | | 48 | 1053 | 1492 |
| XMSS-SHAKE256_16_192 | | | 48 | 1605 | 1636 |
| XMSS-SHAKE256_20_192 | | | 48 | 1973 | 1732 |
| XMSS-SHAKE256_10_256 | | | 64 | 1373 | 2500 |
| XMSS-SHAKE256_16_256 | | | 64 | 2093 | 2692 |
| XMSS-SHAKE256_20_256 | | | 64 | 2573 | 2820 |
| XMSSMT-SHA2_20/2_256 | | | 64 | 5998 | 4963 |
| XMSSMT-SHA2_20/4_256 | | | 64 | 10938 | 9251 |
| XMSSMT-SHA2_40/2_256 | | | 64 | 9600 | 5605 |
Expand Down
18 changes: 18 additions & 0 deletions docs/algorithms/sig_stfl/xmss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ parameter-sets:
length-public-key: 48
length-secret-key: 1973
length-signature: 1732
- name: XMSS-SHAKE256_10_256
claimed-nist-level:
claimed-security:
length-public-key: 64
length-secret-key: 1373
length-signature: 2500
- name: XMSS-SHAKE256_16_256
claimed-nist-level:
claimed-security:
length-public-key: 64
length-secret-key: 2093
length-signature: 2692
- name: XMSS-SHAKE256_20_256
claimed-nist-level:
claimed-security:
length-public-key: 64
length-secret-key: 2573
length-signature: 2820
- name: XMSSMT-SHA2_20/2_256
claimed-nist-level:
claimed-security:
Expand Down
3 changes: 3 additions & 0 deletions src/oqsconfig.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h10_192 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h16_192 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h20_192 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256 1

#cmakedefine OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_2 1
#cmakedefine OQS_ENABLE_SIG_STFL_xmssmt_sha256_h20_4 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 @@ -41,6 +41,9 @@ OQS_API const char *OQS_SIG_STFL_alg_identifier(size_t i) {
OQS_SIG_STFL_alg_xmss_shake256_h10_192,
OQS_SIG_STFL_alg_xmss_shake256_h16_192,
OQS_SIG_STFL_alg_xmss_shake256_h20_192,
OQS_SIG_STFL_alg_xmss_shake256_h10_256,
OQS_SIG_STFL_alg_xmss_shake256_h16_256,
OQS_SIG_STFL_alg_xmss_shake256_h20_256,
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 @@ -225,6 +228,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_shake256_h10_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h16_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256
return 1;
#else
return 0;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h20_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256
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 @@ -649,6 +670,24 @@ OQS_API OQS_SIG_STFL *OQS_SIG_STFL_new(const char *method_name) {
return OQS_SIG_STFL_alg_xmss_shake256_h20_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h10_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256
return OQS_SIG_STFL_alg_xmss_shake256_h10_256_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h16_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256
return OQS_SIG_STFL_alg_xmss_shake256_h16_256_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h20_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256
return OQS_SIG_STFL_alg_xmss_shake256_h20_256_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 @@ -1146,6 +1185,24 @@ OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SIG_STFL_SECRET_KEY_new(const char *method_
return OQS_SECRET_KEY_XMSS_SHAKE256_H20_192_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h10_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256
return OQS_SECRET_KEY_XMSS_SHAKE256_H10_256_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h16_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256
return OQS_SECRET_KEY_XMSS_SHAKE256_H16_256_new();
#else
return NULL;
#endif
} else if (0 == strcasecmp(method_name, OQS_SIG_STFL_alg_xmss_shake256_h20_256)) {
#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256
return OQS_SECRET_KEY_XMSS_SHAKE256_H20_256_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
5 changes: 4 additions & 1 deletion src/sig_stfl/sig_stfl.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ extern "C"
#define OQS_SIG_STFL_alg_xmss_shake256_h10_192 "XMSS-SHAKE256_10_192"
#define OQS_SIG_STFL_alg_xmss_shake256_h16_192 "XMSS-SHAKE256_16_192"
#define OQS_SIG_STFL_alg_xmss_shake256_h20_192 "XMSS-SHAKE256_20_192"
#define OQS_SIG_STFL_alg_xmss_shake256_h10_256 "XMSS-SHAKE256_10_256"
#define OQS_SIG_STFL_alg_xmss_shake256_h16_256 "XMSS-SHAKE256_16_256"
#define OQS_SIG_STFL_alg_xmss_shake256_h20_256 "XMSS-SHAKE256_20_256"

#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"
Expand Down Expand Up @@ -129,7 +132,7 @@ extern "C"
/*
* Total number of stateful variants defined above, used to create the tracking array
*/
#define OQS_SIG_STFL_algs_length 67
#define OQS_SIG_STFL_algs_length 70

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 @@ -124,6 +124,24 @@ if (OQS_ENABLE_SIG_STFL_xmss_shake256_h20_192)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_shake256_h20_192>)
endif()

if (OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256)
add_library(xmss_shake256_h10_256 OBJECT sig_stfl_xmss_shake256_h10_256.c sig_stfl_xmss_functions.c ${SRCS})
target_compile_options(xmss_shake256_h10_256 PRIVATE -DXMSS_PARAMS_NAMESPACE=xmss_shake256_h10_256 -DHASH=5)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_shake256_h10_256>)
endif()

if (OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256)
add_library(xmss_shake256_h16_256 OBJECT sig_stfl_xmss_shake256_h16_256.c sig_stfl_xmss_functions.c ${SRCS})
target_compile_options(xmss_shake256_h16_256 PRIVATE -DXMSS_PARAMS_NAMESPACE=xmss_shake256_h16_256 -DHASH=5)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_shake256_h16_256>)
endif()

if (OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256)
add_library(xmss_shake256_h20_256 OBJECT sig_stfl_xmss_shake256_h20_256.c sig_stfl_xmss_functions.c ${SRCS})
target_compile_options(xmss_shake256_h20_256 PRIVATE -DXMSS_PARAMS_NAMESPACE=xmss_shake256_h20_256 -DHASH=5)
set(_XMSS_OBJS ${_XMSS_OBJS} $<TARGET_OBJECTS:xmss_shake256_h20_256>)
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
55 changes: 55 additions & 0 deletions src/sig_stfl/xmss/sig_stfl_xmss.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
* | XMSS-SHA2_16_192 | 0x0e | 1605 | 48 | 1636 | 24 | ❌ | ✅ | ✅ |
* | XMSS-SHA2_20_192 | 0x0f | 1973 | 48 | 1732 | 24 | ❌ | ✅ | ✅ |
*
* | XMSS-SHAKE256_10_256 | 0x10 | 1373 | 64 | 2500 | 32 | ❌ | ✅ | ✅ |
* | XMSS-SHAKE256_16_256 | 0x11 | 2093 | 64 | 2692 | 32 | ❌ | ✅ | ✅ |
* | XMSS-SHAKE256_20_256 | 0x12 | 2573 | 64 | 2820 | 32 | ❌ | ✅ | ✅ |
*
* | XMSS-SHAKE256_10_192 | 0x13 | 1053 | 48 | 1492 | 24 | ❌ | ✅ | ✅ |
* | XMSS-SHAKE256_16_192 | 0x14 | 1605 | 48 | 1636 | 24 | ❌ | ✅ | ✅ |
* | XMSS-SHAKE256_20_192 | 0x15 | 1973 | 48 | 1732 | 24 | ❌ | ✅ | ✅ |
Expand Down Expand Up @@ -364,6 +368,57 @@ OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_192_sigs_total(unsigned lo

#endif

#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h10_256

#define OQS_SIG_STFL_alg_xmss_shake256_h10_256_oid 0x10
#define OQS_SIG_STFL_alg_xmss_shake256_h10_256_length_sk (1373 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_shake256_h10_256_length_pk (64 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_shake256_h10_256_length_signature 2500

OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake256_h10_256_new(void);
OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H10_256_new(void);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_256_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h10_256_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_256_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_256_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_256_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key);

#endif

#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h16_256

#define OQS_SIG_STFL_alg_xmss_shake256_h16_256_oid 0x11
#define OQS_SIG_STFL_alg_xmss_shake256_h16_256_length_sk (2093 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_shake256_h16_256_length_pk (64 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_shake256_h16_256_length_signature 2692

OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake256_h16_256_new(void);
OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H16_256_new(void);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_256_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h16_256_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_256_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_256_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_256_sigs_total(unsigned long long *total, const OQS_SIG_STFL_SECRET_KEY *secret_key);

#endif

#ifdef OQS_ENABLE_SIG_STFL_xmss_shake256_h20_256

#define OQS_SIG_STFL_alg_xmss_shake256_h20_256_oid 0x12
#define OQS_SIG_STFL_alg_xmss_shake256_h20_256_length_sk (2573 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_shake256_h20_256_length_pk (64 + XMSS_OID_LEN)
#define OQS_SIG_STFL_alg_xmss_shake256_h20_256_length_signature 2820

OQS_API OQS_SIG_STFL *OQS_SIG_STFL_alg_xmss_shake256_h20_256_new(void);
OQS_API OQS_SIG_STFL_SECRET_KEY *OQS_SECRET_KEY_XMSS_SHAKE256_H20_256_new(void);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_256_keypair(uint8_t *public_key, OQS_SIG_STFL_SECRET_KEY *secret_key);
OQS_API OQS_STATUS OQS_SIG_STFL_alg_xmss_shake256_h20_256_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_256_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_256_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_256_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_shake256_h10_256.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-SHAKE256_10_256 ======================== //

XMSS_ALG(, _shake256_h10_256, _SHAKE256_H10_256)
7 changes: 7 additions & 0 deletions src/sig_stfl/xmss/sig_stfl_xmss_shake256_h16_256.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-SHAKE256_16_256 ======================== //

XMSS_ALG(, _shake256_h16_256, _SHAKE256_H16_256)
7 changes: 7 additions & 0 deletions src/sig_stfl/xmss/sig_stfl_xmss_shake256_h20_256.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-SHAKE256_20_256 ======================== //

XMSS_ALG(, _shake256_h20_256, _SHAKE256_H20_256)
3 changes: 3 additions & 0 deletions tests/KATs/sig_stfl/kats.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"XMSS-SHAKE256_10_192": "b62a1dbc2f8920df2f5a164ed175829ed95d5b3301269b0ab2452cd46b4261d6",
"XMSS-SHAKE256_16_192": "935570c4bc7c61e4cdc0517182766dcee53ceec71f91b8dd969568a7f8b76db1",
"XMSS-SHAKE256_20_192": "18067167a1eeee294bf1f0e3087e468b512f7c0c4cfad9c449dc425aab45336b",
"XMSS-SHAKE256_10_256": "7cbb582c6723cb86a9c775151865a67f3f9fa30140beab8f115cd4a7dc15eb2d",
"XMSS-SHAKE256_16_256": "ccc819bc17f78cdb4f2733b97350b7ef351e07d1456564a4185247db1a682fe3",
"XMSS-SHAKE256_20_256": "01ace5400a407030b0cb43ed0982c5f378a1d0c4108fdca2b70bc4ba78067c7f",
"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 51ddd33

Please sign in to comment.