diff --git a/certs/sphincs/bench_sphincs_fast_level1_key.der b/certs/sphincs/bench_sphincs_fast_level1_key.der index fa3dd5b235..2b343d4fdd 100644 Binary files a/certs/sphincs/bench_sphincs_fast_level1_key.der and b/certs/sphincs/bench_sphincs_fast_level1_key.der differ diff --git a/certs/sphincs/bench_sphincs_fast_level3_key.der b/certs/sphincs/bench_sphincs_fast_level3_key.der index 4aac53289b..cd691372ba 100644 Binary files a/certs/sphincs/bench_sphincs_fast_level3_key.der and b/certs/sphincs/bench_sphincs_fast_level3_key.der differ diff --git a/certs/sphincs/bench_sphincs_fast_level5_key.der b/certs/sphincs/bench_sphincs_fast_level5_key.der index 8fa2a32412..19f4f4da07 100644 Binary files a/certs/sphincs/bench_sphincs_fast_level5_key.der and b/certs/sphincs/bench_sphincs_fast_level5_key.der differ diff --git a/certs/sphincs/bench_sphincs_small_level1_key.der b/certs/sphincs/bench_sphincs_small_level1_key.der index 72f750c58c..5133d7bca7 100644 Binary files a/certs/sphincs/bench_sphincs_small_level1_key.der and b/certs/sphincs/bench_sphincs_small_level1_key.der differ diff --git a/certs/sphincs/bench_sphincs_small_level3_key.der b/certs/sphincs/bench_sphincs_small_level3_key.der index 1b3d32561e..691d52e5e3 100644 Binary files a/certs/sphincs/bench_sphincs_small_level3_key.der and b/certs/sphincs/bench_sphincs_small_level3_key.der differ diff --git a/certs/sphincs/bench_sphincs_small_level5_key.der b/certs/sphincs/bench_sphincs_small_level5_key.der index ba78786af3..c90cdf68b3 100644 Binary files a/certs/sphincs/bench_sphincs_small_level5_key.der and b/certs/sphincs/bench_sphincs_small_level5_key.der differ diff --git a/cmake/functions.cmake b/cmake/functions.cmake index e77991ea14..f0fc48c2e9 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -195,6 +195,9 @@ function(generate_build_flags) endif() if(WOLFSSL_OQS OR WOLFSSL_USER_SETTINGS) set(BUILD_FALCON "yes" PARENT_SCOPE) + set(BUILD_SPHINCS "yes" PARENT_SCOPE) + set(BUILD_DILITHIUM "yes" PARENT_SCOPE) + set(BUILD_EXT_KYBER "yes" PARENT_SCOPE) endif() set(BUILD_INLINE ${WOLFSSL_INLINE} PARENT_SCOPE) if(WOLFSSL_OCSP OR WOLFSSL_USER_SETTINGS) @@ -804,6 +807,18 @@ function(generate_lib_src_list LIB_SOURCES) list(APPEND LIB_SOURCES wolfcrypt/src/falcon.c) endif() + if(BUILD_SPHINCS) + list(APPEND LIB_SOURCES wolfcrypt/src/sphincs.c) + endif() + + if(BUILD_DILITHIUM) + list(APPEND LIB_SOURCES wolfcrypt/src/dilithium.c) + endif() + + if(BUILD_EXT_KYBER) + list(APPEND LIB_SOURCES wolfcrypt/src/ext_kyber.c) + endif() + if(BUILD_LIBZ) list(APPEND LIB_SOURCES wolfcrypt/src/compress.c) endif() diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 26eb033ef2..747f73c7f6 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -892,17 +892,17 @@ static const bench_pq_alg bench_pq_asym_opt[] = { static const bench_pq_alg bench_pq_asym_opt2[] = { { "-pq", 0xffffffff, NULL}, { "-sphincs_fast_level1", BENCH_SPHINCS_FAST_LEVEL1_SIGN, - OQS_SIG_alg_sphincs_shake256_128f_simple }, + OQS_SIG_alg_sphincs_shake_128f_simple }, { "-sphincs_fast_level3", BENCH_SPHINCS_FAST_LEVEL3_SIGN, - OQS_SIG_alg_sphincs_shake256_192f_simple }, + OQS_SIG_alg_sphincs_shake_192f_simple }, { "-sphincs_fast_level5", BENCH_SPHINCS_FAST_LEVEL5_SIGN, - OQS_SIG_alg_sphincs_shake256_256f_simple }, + OQS_SIG_alg_sphincs_shake_256f_simple }, { "-sphincs_small_level1", BENCH_SPHINCS_SMALL_LEVEL1_SIGN, - OQS_SIG_alg_sphincs_shake256_128s_simple }, + OQS_SIG_alg_sphincs_shake_128s_simple }, { "-sphincs_small_level3", BENCH_SPHINCS_SMALL_LEVEL3_SIGN, - OQS_SIG_alg_sphincs_shake256_192s_simple }, + OQS_SIG_alg_sphincs_shake_192s_simple }, { "-sphincs_small_level5", BENCH_SPHINCS_SMALL_LEVEL5_SIGN, - OQS_SIG_alg_sphincs_shake256_256s_simple }, + OQS_SIG_alg_sphincs_shake_256s_simple }, { NULL, 0, NULL } }; #endif /* HAVE_LIBOQS */ diff --git a/wolfcrypt/src/sphincs.c b/wolfcrypt/src/sphincs.c index 2600b7754b..65bb57a9cf 100644 --- a/wolfcrypt/src/sphincs.c +++ b/wolfcrypt/src/sphincs.c @@ -76,22 +76,22 @@ int wc_sphincs_sign_msg(const byte* in, word32 inLen, byte* out, word32 *outLen, if (ret == 0) { if ((key->optim == FAST_VARIANT) && (key->level == 1)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_128f_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_128f_simple); } else if ((key->optim == FAST_VARIANT) && (key->level == 3)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_192f_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_192f_simple); } else if ((key->optim == FAST_VARIANT) && (key->level == 5)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_256f_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_256f_simple); } else if ((key->optim == SMALL_VARIANT) && (key->level == 1)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_128s_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_128s_simple); } else if ((key->optim == SMALL_VARIANT) && (key->level == 3)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_192s_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_192s_simple); } else if ((key->optim == SMALL_VARIANT) && (key->level == 5)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_256s_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_256s_simple); } if (oqssig == NULL) { @@ -183,22 +183,22 @@ int wc_sphincs_verify_msg(const byte* sig, word32 sigLen, const byte* msg, if (ret == 0) { if ((key->optim == FAST_VARIANT) && (key->level == 1)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_128f_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_128f_simple); } else if ((key->optim == FAST_VARIANT) && (key->level == 3)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_192f_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_192f_simple); } else if ((key->optim == FAST_VARIANT) && (key->level == 5)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_256f_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_256f_simple); } else if ((key->optim == SMALL_VARIANT) && (key->level == 1)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_128s_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_128s_simple); } else if ((key->optim == SMALL_VARIANT) && (key->level == 3)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_192s_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_192s_simple); } else if ((key->optim == SMALL_VARIANT) && (key->level == 5)) { - oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake256_256s_simple); + oqssig = OQS_SIG_new(OQS_SIG_alg_sphincs_shake_256s_simple); } if (oqssig == NULL) { @@ -244,7 +244,7 @@ int wc_sphincs_init(sphincs_key* key) /* Set the level of the sphincs private/public key. * * key [out] Sphincs key. - * level [in] Either 2,3 or 5. + * level [in] Either 1, 3 or 5. * optim [in] Either FAST_VARIANT or SMALL_VARIANT. * returns BAD_FUNC_ARG when key is NULL or level or optim are bad values. */ diff --git a/wolfssl/certs_test.h b/wolfssl/certs_test.h index aac97e7214..e20cdbc1e7 100644 --- a/wolfssl/certs_test.h +++ b/wolfssl/certs_test.h @@ -5865,17 +5865,17 @@ static const int sizeof_bench_dilithium_level5_key = sizeof(bench_dilithium_leve static const unsigned char bench_sphincs_fast_level1_key[] = { 0x30, 0x71, 0x02, 0x01, 0x00, 0x30, 0x08, 0x06, 0x06, 0x2B, - 0xCE, 0x0F, 0x06, 0x07, 0x04, 0x04, 0x62, 0x04, 0x60, 0x59, - 0xE0, 0xD4, 0x1F, 0x22, 0x74, 0xBD, 0xAC, 0x46, 0x01, 0xE4, - 0x8C, 0x89, 0xB7, 0x39, 0x20, 0x9F, 0x6F, 0x96, 0xC4, 0xE7, - 0x78, 0x0F, 0xA1, 0x7D, 0xEC, 0xE8, 0xD5, 0xC3, 0xDD, 0x45, - 0x13, 0x56, 0xCF, 0xEA, 0x68, 0x70, 0x2A, 0xFF, 0xDA, 0x9A, - 0xA3, 0x2B, 0xEC, 0x4D, 0xBF, 0x7D, 0x09, 0xC0, 0xCC, 0xF4, - 0x2F, 0xF2, 0xAC, 0x74, 0xDF, 0x0E, 0x20, 0x9D, 0xC2, 0x9E, - 0xD1, 0xB4, 0x12, 0x56, 0xCF, 0xEA, 0x68, 0x70, 0x2A, 0xFF, - 0xDA, 0x9A, 0xA3, 0x2B, 0xEC, 0x4D, 0xBF, 0x7D, 0x09, 0xC0, - 0xCC, 0xF4, 0x2F, 0xF2, 0xAC, 0x74, 0xDF, 0x0E, 0x20, 0x9D, - 0xC2, 0x9E, 0xD1, 0xB4, 0x12 + 0xCE, 0x0F, 0x06, 0x07, 0x0D, 0x04, 0x62, 0x04, 0x60, 0xD8, + 0xC4, 0x6E, 0x8D, 0x3B, 0xB7, 0xE7, 0x48, 0x8D, 0x6F, 0x0C, + 0x3D, 0xDF, 0xAB, 0x79, 0xB6, 0x62, 0xAE, 0x89, 0x19, 0x6F, + 0x5E, 0xF9, 0xD3, 0x3A, 0x69, 0xBA, 0xFF, 0x4C, 0x46, 0xDE, + 0xAA, 0x7C, 0x40, 0x79, 0x8C, 0xE1, 0xE5, 0x30, 0xE6, 0xDF, + 0x4E, 0x23, 0x5E, 0x14, 0xDB, 0x0A, 0x48, 0x4E, 0xF6, 0x57, + 0xCE, 0x45, 0x8F, 0x8B, 0x1D, 0x68, 0x63, 0xAA, 0x24, 0xA4, + 0xE1, 0x0D, 0xFB, 0x7C, 0x40, 0x79, 0x8C, 0xE1, 0xE5, 0x30, + 0xE6, 0xDF, 0x4E, 0x23, 0x5E, 0x14, 0xDB, 0x0A, 0x48, 0x4E, + 0xF6, 0x57, 0xCE, 0x45, 0x8F, 0x8B, 0x1D, 0x68, 0x63, 0xAA, + 0x24, 0xA4, 0xE1, 0x0D, 0xFB }; static const int sizeof_bench_sphincs_fast_level1_key = sizeof(bench_sphincs_fast_level1_key); @@ -5883,22 +5883,22 @@ static const int sizeof_bench_sphincs_fast_level1_key = sizeof(bench_sphincs_fas static const unsigned char bench_sphincs_fast_level3_key[] = { 0x30, 0x81, 0xA3, 0x02, 0x01, 0x00, 0x30, 0x08, 0x06, 0x06, - 0x2B, 0xCE, 0x0F, 0x06, 0x08, 0x03, 0x04, 0x81, 0x93, 0x04, - 0x81, 0x90, 0x00, 0x8E, 0xB0, 0x75, 0x2E, 0xC5, 0x61, 0x66, - 0xEE, 0x01, 0xEE, 0x97, 0x13, 0xD7, 0x65, 0x69, 0xEA, 0x5C, - 0x23, 0xAA, 0x6E, 0x86, 0x04, 0xE9, 0x2A, 0xEC, 0x8C, 0xA3, - 0xB7, 0x28, 0xEB, 0xDF, 0x0E, 0x77, 0x07, 0x59, 0x3F, 0xB6, - 0x10, 0xB3, 0xCC, 0xE1, 0x09, 0x64, 0xC4, 0x42, 0x37, 0x71, - 0xDC, 0xB4, 0x20, 0x2D, 0x03, 0x00, 0x6C, 0x4C, 0x3F, 0xE3, - 0x80, 0x28, 0xEC, 0x90, 0xF9, 0xDB, 0x50, 0xFC, 0x0A, 0x58, - 0xC2, 0x81, 0xE2, 0x17, 0x06, 0x7A, 0x58, 0xBB,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, 0xB7, 0xC8, 0x7D, 0x37, 0xF3, 0x90, 0xF7, + 0x46, 0x92, 0xB6, 0x26, 0xF7, 0x4E, 0x0D, 0x8D, 0xB8, 0xCA, + 0x8B, 0xA8, 0x20, 0x5D, 0x67, 0x85, 0xD2, 0x83, 0x2C, 0x2A, + 0x38, 0x1F, 0x57, 0x89, 0x76, 0x8C, 0x6D, 0x88, 0xCE, 0x18, + 0x4F, 0xA7, 0x88, 0x48, 0x7C, 0x0D }; static const int sizeof_bench_sphincs_fast_level3_key = sizeof(bench_sphincs_fast_level3_key); @@ -5906,27 +5906,27 @@ static const int sizeof_bench_sphincs_fast_level3_key = sizeof(bench_sphincs_fas static const unsigned char bench_sphincs_fast_level5_key[] = { 0x30, 0x81, 0xD3, 0x02, 0x01, 0x00, 0x30, 0x08, 0x06, 0x06, - 0x2B, 0xCE, 0x0F, 0x06, 0x09, 0x03, 0x04, 0x81, 0xC3, 0x04, - 0x81, 0xC0, 0x91, 0x8B, 0xB7, 0x1A, 0x08, 0x61, 0x50, 0x70, - 0x26, 0x71, 0xCD, 0x36, 0x10, 0xE2, 0xB8, 0x95, 0x0D, 0xA7, - 0x57, 0xC7, 0x18, 0xFF, 0x55, 0xA4, 0x16, 0x9D, 0x3C, 0xF8, - 0xA3, 0x48, 0xB0, 0x9B, 0xFD, 0x22, 0xBE, 0x20, 0x3D, 0x88, - 0x96, 0x0B, 0xF1, 0x6D, 0x05, 0x8A, 0x1B, 0x71, 0xCE, 0xCD, - 0x31, 0x01, 0xEA, 0xAC, 0x62, 0x61, 0x1F, 0x4A, 0xC1, 0x62, - 0x05, 0x36, 0xBB, 0x7F, 0xEF, 0x5B, 0x42, 0x8B, 0xC6, 0xCD, - 0xEF, 0xCE, 0xE1, 0x00, 0x39, 0x4F, 0x01, 0xBC, 0x03, 0x94, - 0x00, 0xA8, 0x7F, 0x22, 0xB9, 0x9F, 0x79, 0x51, 0x25, 0x61, - 0x1B, 0x43, 0x47, 0x52, 0xD0, 0x39, 0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 0x11, 0x0E, + 0xCF, 0x33, 0x54, 0x85, 0x56, 0x0C, 0xEB, 0x2A, 0xB0, 0xAA, + 0xEB, 0x74, 0x14, 0x89, 0x1A, 0xB9, 0x38, 0xF5, 0x29, 0x66, + 0x28, 0x28, 0x17, 0xF5, 0x72, 0x42, 0xEE, 0xC0, 0x14, 0x59, + 0xA0, 0x72, 0x9B, 0x9B, 0x1E, 0x7F, 0x70, 0x70, 0xBB, 0x89, + 0x0C, 0x7E, 0x87, 0x8B, 0x83, 0x80, 0x2B, 0x66, 0x58, 0x64, + 0x1D, 0x94, 0xAF, 0x58, 0xB5, 0x23, 0x2C, 0xA1, 0xE9, 0x95, + 0x99, 0xFA, 0x11, 0x0E, 0xCF, 0x33, 0x54, 0x85, 0x56, 0x0C, + 0xEB, 0x2A, 0xB0, 0xAA, 0xEB, 0x74, 0x14, 0x89, 0x1A, 0xB9, + 0x38, 0xF5, 0x29, 0x66, 0x28, 0x28, 0x17, 0xF5, 0x72, 0x42, + 0xEE, 0xC0, 0x14, 0x59, 0xA0, 0x72, 0x9B, 0x9B, 0x1E, 0x7F, + 0x70, 0x70, 0xBB, 0x89, 0x0C, 0x7E, 0x87, 0x8B, 0x83, 0x80, + 0x2B, 0x66, 0x58, 0x64, 0x1D, 0x94, 0xAF, 0x58, 0xB5, 0x23, + 0x2C, 0xA1, 0xE9, 0x95 }; static const int sizeof_bench_sphincs_fast_level5_key = sizeof(bench_sphincs_fast_level5_key); @@ -5934,17 +5934,17 @@ static const int sizeof_bench_sphincs_fast_level5_key = sizeof(bench_sphincs_fas static const unsigned char bench_sphincs_small_level1_key[] = { 0x30, 0x71, 0x02, 0x01, 0x00, 0x30, 0x08, 0x06, 0x06, 0x2B, - 0xCE, 0x0F, 0x06, 0x07, 0x0A, 0x04, 0x62, 0x04, 0x60, 0x44, - 0x7A, 0xCF, 0xB9, 0x03, 0xF2, 0xB2, 0x41, 0xBC, 0x1A, 0xE6, - 0x75, 0x29, 0x04, 0xDA, 0x6C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, 0x57, 0x8A, 0xD7, 0x44 }; static const int sizeof_bench_sphincs_small_level1_key = sizeof(bench_sphincs_small_level1_key); @@ -5952,22 +5952,22 @@ static const int sizeof_bench_sphincs_small_level1_key = sizeof(bench_sphincs_sm static const unsigned char bench_sphincs_small_level3_key[] = { 0x30, 0x81, 0xA3, 0x02, 0x01, 0x00, 0x30, 0x08, 0x06, 0x06, - 0x2B, 0xCE, 0x0F, 0x06, 0x08, 0x07, 0x04, 0x81, 0x93, 0x04, - 0x81, 0x90, 0x7E, 0x80, 0x20, 0x6C, 0x20, 0xAE, 0x7D, 0xAB, - 0xC1, 0x4E, 0x15, 0x51, 0x0C, 0xDD, 0x96, 0xAC, 0xFB, 0xD2, - 0x5B, 0xF1, 0xEB, 0x51, 0xDC, 0xC3, 0xB3, 0x92, 0x33, 0xC2, - 0x54, 0x59, 0x4F, 0xB2, 0x33, 0x7C, 0x10, 0xC6, 0xA3, 0x49, - 0x8D, 0x07, 0x52, 0xB2, 0xA1, 0x14, 0x0C, 0x54, 0x21, 0xD4, - 0xB1, 0xCC, 0xBD, 0xB1, 0x20, 0xAC, 0xF1, 0xBD, 0xF5, 0x60, - 0x2F, 0x07, 0x98, 0x57, 0x4E, 0x31, 0x6F, 0x42, 0x84, 0xCE, - 0x71, 0x72, 0x74, 0x20, 0xDF, 0x38, 0x39, 0xFB, 0xD3, 0xEE, - 0xAD, 0xFB, 0xB6, 0x2B, 0x60, 0x61, 0x85, 0xF1, 0x2A, 0x59, - 0x00, 0xA5, 0xCA, 0xC8, 0xE3, 0x3F, 0x96, 0xE9, 0xB1, 0xCC, - 0xBD, 0xB1, 0x20, 0xAC, 0xF1, 0xBD, 0xF5, 0x60, 0x2F, 0x07, - 0x98, 0x57, 0x4E, 0x31, 0x6F, 0x42, 0x84, 0xCE, 0x71, 0x72, - 0x74, 0x20, 0xDF, 0x38, 0x39, 0xFB, 0xD3, 0xEE, 0xAD, 0xFB, - 0xB6, 0x2B, 0x60, 0x61, 0x85, 0xF1, 0x2A, 0x59, 0x00, 0xA5, - 0xCA, 0xC8, 0xE3, 0x3F, 0x96, 0xE9 + 0x2B, 0xCE, 0x0F, 0x06, 0x08, 0x0C, 0x04, 0x81, 0x93, 0x04, + 0x81, 0x90, 0x59, 0xC1, 0x44, 0x8A, 0x5F, 0xF3, 0xF1, 0xB3, + 0xB8, 0xFF, 0x98, 0x7F, 0x86, 0x4A, 0x4C, 0x19, 0xFC, 0x51, + 0xB8, 0x12, 0x87, 0x9C, 0x52, 0xD6, 0x7F, 0xD6, 0xB0, 0xA9, + 0xF7, 0xED, 0x44, 0x26, 0xAF, 0xC2, 0xCE, 0x47, 0xD9, 0xE3, + 0x95, 0x1A, 0xE6, 0x11, 0xC1, 0x37, 0x67, 0xA5, 0x89, 0xDD, + 0x37, 0x6A, 0xE9, 0xC3, 0x8C, 0x9B, 0x3E, 0xBA, 0xB1, 0x76, + 0x4A, 0x5A, 0xEE, 0xCD, 0x96, 0x66, 0xF2, 0x53, 0xDA, 0x8C, + 0x89, 0x69, 0xBF, 0xBF, 0xF9, 0xA5, 0xBC, 0x7D, 0x80, 0xA8, + 0x97, 0x63, 0x90, 0x55, 0x58, 0x6C, 0x0A, 0x52, 0x61, 0x0B, + 0xF3, 0xBC, 0xE1, 0x1F, 0xB4, 0xA6, 0x5F, 0x9F, 0x37, 0x6A, + 0xE9, 0xC3, 0x8C, 0x9B, 0x3E, 0xBA, 0xB1, 0x76, 0x4A, 0x5A, + 0xEE, 0xCD, 0x96, 0x66, 0xF2, 0x53, 0xDA, 0x8C, 0x89, 0x69, + 0xBF, 0xBF, 0xF9, 0xA5, 0xBC, 0x7D, 0x80, 0xA8, 0x97, 0x63, + 0x90, 0x55, 0x58, 0x6C, 0x0A, 0x52, 0x61, 0x0B, 0xF3, 0xBC, + 0xE1, 0x1F, 0xB4, 0xA6, 0x5F, 0x9F }; static const int sizeof_bench_sphincs_small_level3_key = sizeof(bench_sphincs_small_level3_key); @@ -5975,27 +5975,27 @@ static const int sizeof_bench_sphincs_small_level3_key = sizeof(bench_sphincs_sm static const unsigned char bench_sphincs_small_level5_key[] = { 0x30, 0x81, 0xD3, 0x02, 0x01, 0x00, 0x30, 0x08, 0x06, 0x06, - 0x2B, 0xCE, 0x0F, 0x06, 0x09, 0x07, 0x04, 0x81, 0xC3, 0x04, - 0x81, 0xC0, 0x5E, 0xEA, 0x46, 0x6D, 0xE5, 0xA1, 0x70, 0x07, - 0xF0, 0x5C, 0x59, 0xD5, 0xD7, 0x37, 0x06, 0xC7, 0xD6, 0x1C, - 0xEA, 0x06, 0x15, 0x6E, 0xB3, 0x07, 0x71, 0x34, 0xE8, 0xD4, - 0x13, 0x65, 0x58, 0xAE, 0xAC, 0xE9, 0x32, 0x26, 0x76, 0xCD, - 0x2C, 0x3D, 0x11, 0xF7, 0xAB, 0x8A, 0x84, 0x4F, 0x56, 0x6F, - 0x2F, 0x63, 0x82, 0x1A, 0x37, 0xAA, 0xAA, 0x49, 0x50, 0xC8, - 0xA5, 0x92, 0x6E, 0x3F, 0xD6, 0x67, 0xEA, 0x5C, 0x18, 0x8A, - 0x99, 0xD2, 0xB6, 0xE3, 0xD7, 0x68, 0x9E, 0x65, 0x21, 0xDD, - 0xE3, 0x44, 0x8B, 0x32, 0x30, 0x31, 0xA8, 0xF2, 0xBB, 0xED, - 0xC0, 0x3E, 0x1A, 0x7B, 0x36, 0xD8, 0xAD, 0x2A, 0xA4, 0x81, - 0xAC, 0xD3, 0x08, 0xAC, 0x54, 0x2A, 0xAC, 0xAA, 0x1B, 0x64, - 0x58, 0x7B, 0x94, 0xE0, 0x16, 0x36, 0xC9, 0x92, 0x09, 0x6A, - 0x8C, 0x4D, 0xE3, 0xAB, 0x0F, 0x1C, 0xE8, 0x77, 0x1F, 0xE5, - 0xEA, 0x5C, 0x18, 0x8A, 0x99, 0xD2, 0xB6, 0xE3, 0xD7, 0x68, - 0x9E, 0x65, 0x21, 0xDD, 0xE3, 0x44, 0x8B, 0x32, 0x30, 0x31, - 0xA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 0xBE, 0x94, 0xC2, 0x69, + 0x14, 0x03, 0xD4, 0x54, 0x01, 0x9D, 0x9D, 0x5D, 0x42, 0xC1, + 0x2B, 0x91, 0xC3, 0xA2, 0xD3, 0x12, 0x67, 0x35, 0x3B, 0xD7, + 0x67, 0x31, 0xD5, 0xDC, 0xDF, 0x4C, 0x4C, 0xAA, 0x45, 0xA8, + 0x5D, 0x1E, 0xFB, 0x9E, 0x34, 0x5D, 0x4B, 0x83, 0x77, 0xBF, + 0x52, 0x8A, 0xDB, 0x67, 0x7A, 0x52, 0xA4, 0x02, 0x29, 0xEB, + 0x34, 0x9A, 0x4E, 0x86, 0x25, 0x66, 0xFF, 0xA0, 0x79, 0x47, + 0xBE, 0x94, 0xC2, 0x69 }; static const int sizeof_bench_sphincs_small_level5_key = sizeof(bench_sphincs_small_level5_key); diff --git a/wolfssl/wolfcrypt/sphincs.h b/wolfssl/wolfcrypt/sphincs.h index c1f558f963..958d8529b6 100644 --- a/wolfssl/wolfcrypt/sphincs.h +++ b/wolfssl/wolfcrypt/sphincs.h @@ -24,12 +24,12 @@ */ /* Interfaces for Sphincs: - * - SPHINCS_FAST_LEVEL1 (AKA SPHINCS+-SHAKE256-128f-simple) - * - SPHINCS_FAST_LEVEL3 (AKA SPHINCS+-SHAKE256-192f-simple) - * - SPHINCS_FAST_LEVEL5 (AKA SPHINCS+-SHAKE256-256f-simple) - * - SPHINCS_SMALL_LEVEL1 (AKA SPHINCS+-SHAKE256-128s-simple) - * - SPHINCS_SMALL_LEVEL3 (AKA SPHINCS+-SHAKE256-192s-simple) - * - SPHINCS_SMALL_LEVEL5 (AKA SPHINCS+-SHAKE256-256s-simple) + * - SPHINCS_FAST_LEVEL1 (AKA SPHINCS+-SHAKE-128f-simple) + * - SPHINCS_FAST_LEVEL3 (AKA SPHINCS+-SHAKE-192f-simple) + * - SPHINCS_FAST_LEVEL5 (AKA SPHINCS+-SHAKE-256f-simple) + * - SPHINCS_SMALL_LEVEL1 (AKA SPHINCS+-SHAKE-128s-simple) + * - SPHINCS_SMALL_LEVEL3 (AKA SPHINCS+-SHAKE-192s-simple) + * - SPHINCS_SMALL_LEVEL5 (AKA SPHINCS+-SHAKE-256s-simple) */ #ifndef WOLF_CRYPT_SPHINCS_H @@ -51,23 +51,23 @@ #ifdef HAVE_LIBOQS -#define SPHINCS_FAST_LEVEL1_SIG_SIZE OQS_SIG_sphincs_shake256_128f_simple_length_signature -#define SPHINCS_FAST_LEVEL3_SIG_SIZE OQS_SIG_sphincs_shake256_192f_simple_length_signature -#define SPHINCS_FAST_LEVEL5_SIG_SIZE OQS_SIG_sphincs_shake256_256f_simple_length_signature -#define SPHINCS_SMALL_LEVEL1_SIG_SIZE OQS_SIG_sphincs_shake256_128s_simple_length_signature -#define SPHINCS_SMALL_LEVEL3_SIG_SIZE OQS_SIG_sphincs_shake256_192s_simple_length_signature -#define SPHINCS_SMALL_LEVEL5_SIG_SIZE OQS_SIG_sphincs_shake256_256s_simple_length_signature +#define SPHINCS_FAST_LEVEL1_SIG_SIZE OQS_SIG_sphincs_shake_128f_simple_length_signature +#define SPHINCS_FAST_LEVEL3_SIG_SIZE OQS_SIG_sphincs_shake_192f_simple_length_signature +#define SPHINCS_FAST_LEVEL5_SIG_SIZE OQS_SIG_sphincs_shake_256f_simple_length_signature +#define SPHINCS_SMALL_LEVEL1_SIG_SIZE OQS_SIG_sphincs_shake_128s_simple_length_signature +#define SPHINCS_SMALL_LEVEL3_SIG_SIZE OQS_SIG_sphincs_shake_192s_simple_length_signature +#define SPHINCS_SMALL_LEVEL5_SIG_SIZE OQS_SIG_sphincs_shake_256s_simple_length_signature -#define SPHINCS_LEVEL1_KEY_SIZE OQS_SIG_sphincs_shake256_128f_simple_length_secret_key -#define SPHINCS_LEVEL1_PUB_KEY_SIZE OQS_SIG_sphincs_shake256_128f_simple_length_public_key +#define SPHINCS_LEVEL1_KEY_SIZE OQS_SIG_sphincs_shake_128f_simple_length_secret_key +#define SPHINCS_LEVEL1_PUB_KEY_SIZE OQS_SIG_sphincs_shake_128f_simple_length_public_key #define SPHINCS_LEVEL1_PRV_KEY_SIZE (SPHINCS_LEVEL1_PUB_KEY_SIZE+SPHINCS_LEVEL1_KEY_SIZE) -#define SPHINCS_LEVEL3_KEY_SIZE OQS_SIG_sphincs_shake256_192f_simple_length_secret_key -#define SPHINCS_LEVEL3_PUB_KEY_SIZE OQS_SIG_sphincs_shake256_192f_simple_length_public_key +#define SPHINCS_LEVEL3_KEY_SIZE OQS_SIG_sphincs_shake_192f_simple_length_secret_key +#define SPHINCS_LEVEL3_PUB_KEY_SIZE OQS_SIG_sphincs_shake_192f_simple_length_public_key #define SPHINCS_LEVEL3_PRV_KEY_SIZE (SPHINCS_LEVEL3_PUB_KEY_SIZE+SPHINCS_LEVEL3_KEY_SIZE) -#define SPHINCS_LEVEL5_KEY_SIZE OQS_SIG_sphincs_shake256_256f_simple_length_secret_key -#define SPHINCS_LEVEL5_PUB_KEY_SIZE OQS_SIG_sphincs_shake256_256f_simple_length_public_key +#define SPHINCS_LEVEL5_KEY_SIZE OQS_SIG_sphincs_shake_256f_simple_length_secret_key +#define SPHINCS_LEVEL5_PUB_KEY_SIZE OQS_SIG_sphincs_shake_256f_simple_length_public_key #define SPHINCS_LEVEL5_PRV_KEY_SIZE (SPHINCS_LEVEL5_PUB_KEY_SIZE+SPHINCS_LEVEL5_KEY_SIZE) #endif