From 7c14ea67aeb58deea534bbe37758b41b5d8114b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iy=C3=A1n=20M=C3=A9ndez=20Veiga?= Date: Wed, 5 Jul 2023 17:07:34 +0200 Subject: [PATCH] Rename sphincs algs to follow upstream This also adds new keys for SPHINCS+. The reason is that SPHINCS+ was updated to 3.1 in liboqs (open-quantum-safe/liboqs/pull/1420), and old keys are incompatible with the new implementation. Keys were generated using the oqs-provider for OpenSSL 3 openssl genpkey \ -provider default -provider oqsprovider \ -algorithm sphincsshake128fsimple \ -outform der \ -out bench_sphincs_fast_level1_key.der And certs_test.h was updated using xxd xxd -i -c 10 -u bench_sphincs_fast_level1_key.der This was repeated for the 6 variants of SPHINCS+ that wolfSSL supports. --- .../sphincs/bench_sphincs_fast_level1_key.der | Bin 115 -> 115 bytes .../sphincs/bench_sphincs_fast_level3_key.der | Bin 166 -> 166 bytes .../sphincs/bench_sphincs_fast_level5_key.der | Bin 214 -> 214 bytes .../bench_sphincs_small_level1_key.der | Bin 115 -> 115 bytes .../bench_sphincs_small_level3_key.der | Bin 166 -> 166 bytes .../bench_sphincs_small_level5_key.der | Bin 214 -> 214 bytes wolfcrypt/benchmark/benchmark.c | 12 +- wolfcrypt/src/sphincs.c | 26 +-- wolfssl/certs_test.h | 204 +++++++++--------- wolfssl/wolfcrypt/sphincs.h | 36 ++-- 10 files changed, 139 insertions(+), 139 deletions(-) diff --git a/certs/sphincs/bench_sphincs_fast_level1_key.der b/certs/sphincs/bench_sphincs_fast_level1_key.der index fa3dd5b235ae674d858569fd71d08b731c0c3056..2b343d4fdd012b37191a35e76334b47ecc8e4277 100644 GIT binary patch literal 115 zcmXpgWMX76;9z6ZKF80-&dZX-l5pclUa$4`=N`TJJht~&S8hvM*D0AF_w%w<=C1!f rZueHzI8^pLd}{FQzMpcO$ZakUzi;8^T>HCaGm=-SEP2TLn~*#Jp4~Hg literal 115 zcmXpgWMX76;9z6ZKF80-&cc$!k`Vdeio8d@H!rRp szUwL+cK%gHf!6<9vleT=@!em`dEm?!{ZDI3?(-?kJv8s)79m3N03`-EKmY&$ diff --git a/certs/sphincs/bench_sphincs_fast_level3_key.der b/certs/sphincs/bench_sphincs_fast_level3_key.der index 4aac53289b8baf7adfd2c9f61c08bff0472de585..cd691372bad05482b36b3118742745f2b06acaec 100644 GIT binary patch literal 166 zcmXqLT+GDCV8Fq~rhSf|jf0D&aWYHegiTiI%e?z`zF#}@iEZkOcjwof*T1(%Fuk|G z*KVd^`dh;+R`-Lqj*5scoZRdZ!P#Ktp6->%3WeD8 c)=SMgS{Cx*on<|_9p@zcmv?y7@RF(?04Xp@M*si- literal 166 zcmXqLT+GDCV8Fq~rhSf|jf0t`aWYHe1cts1rFusb)7~+@n=X7kHS<-B@~XTxmX}&@ zdKPcjczvI*oITQho51EX4>?ngIGGpT*`lD!%#h<_|F}Wp&4iz~1O9MD9BO%mD0ErVy!Td#-1-me{=T8?@6RQe>yBkJzfL Lv+(6qO7#N(w5nnf literal 214 zcmXqLyv)SNV8Fq~rhSf|jgy(B@i0r{fr;JQr8p7;3e*bEnh8AGF_m|D_;HEmeShvDgQY*? z9_A?wE9#YY&aVtqO_X+a54vEfJ^APrt%vWq8O;udoVfR8QNEA&o7lPUPX5~WEB;95 L!9TB8P^upQ+CpZs diff --git a/certs/sphincs/bench_sphincs_small_level1_key.der b/certs/sphincs/bench_sphincs_small_level1_key.der index 72f750c58c836efc238da53d017942844db5471b..5133d7bca7ec30a1f028fc03a76b92339fc2203d 100644 GIT binary patch literal 115 zcmXpgWMX76;9z6ZKF80-F2It+lJH+GEOku|cad)I4oxr7y7!@f_kB6=EML27dP1Pg r=_Y5Fdm^^}&uwHj@1Fl+e*coSJA)1yem~e&SNwZkQFzyN7eev?Z%Q?` literal 115 zcmXpgWMX76;9z6ZKF80-&c%|%lHgKxekb#%O^$n{o|S5{+{(%05SMc+ePN`0R`5i} rcLqV9y&_46yqnGLC05jPicOzk8&pvLw(WMQQ_$y)>k8^G6Oso2R97$I diff --git a/certs/sphincs/bench_sphincs_small_level3_key.der b/certs/sphincs/bench_sphincs_small_level3_key.der index 1b3d32561efd286928ed2a04c1a4dac586c88b51..691d52e5e393fa25ba918fd105b3a45a57fb6239 100644 GIT binary patch literal 166 zcmXqLT+GDCV8Fq~rhSf|jf01!aWYHegvf&~UGbkkZr<^KMtz%?kK~`g9YXDMg09tH z+pzNcTNkzUht9d*d^}a^nczY5^rfA5&9hz}?wM`3Yh#&L)Vs6O(mn;>>gmkfzyIgb eJ+%!hrYBDbjmY5&O62~$=b`+TW%2V#RSy6mTUBrX literal 166 zcmXqLT+GDCV8Fq~rhSf|jf0(~aWYHegt`WW9EEkYs}K5#2J+mUw&wSx=#Q@h?;PGd z$@ox6r2i)48i8YrJ$u=MHZ2t42~oVV@yy z+XMA;19tGvn&0zc_KRO~9~RCy)opU6F!;lA*=xM_lM|N$stkXg5 ziH8?m7D_j@zMgJ)_0D}CpH;3aV%Gl}(XF5e&2bvwN(XbF?%Ym-@iZK`Si7gW0M Kn{p_VQvCpl!ejUV literal 214 zcmXqLyv)SNV8Fq~rhSf|jgy_F@i0r{fw)(0xlb1suz!e&yn5Z7?f5mBS8Sqro7oFZ zUR)7QjaawlrIA|MSsh!!@2k67{KN9~lbfW>SFQ34II(n6p8d7-S1}S@GcRp>d_7}c zs^Zoptim == 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..5e0c792085 100644 --- a/wolfssl/certs_test.h +++ b/wolfssl/certs_test.h @@ -5864,138 +5864,138 @@ static const int sizeof_bench_dilithium_level5_key = sizeof(bench_dilithium_leve /* certs/sphincs/bench_sphincs_fast_level1_key.der */ 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 + 0X30, 0X71, 0X02, 0X01, 0X00, 0X30, 0X08, 0X06, 0X06, 0X2B, + 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); /* certs/sphincs/bench_sphincs_fast_level3_key.der */ 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, 0x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X99, + 0X31, 0X67, 0XED, 0X31, 0X6A, 0X05, 0X47, 0XC1, 0XDA, 0XC5, + 0X14, 0X17, 0XA1, 0X93, 0X83, 0X44, 0X58, 0X09, 0X80, 0X3A, + 0X47, 0X67, 0X42, 0X6D, 0X4C, 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, 0X47, 0X67, + 0X42, 0X6D, 0X4C, 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); /* certs/sphincs/bench_sphincs_fast_level5_key.der */ 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, 0x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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); /* certs/sphincs/bench_sphincs_small_level1_key.der */ 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, 0x6E, 0x08, 0x17, 0x1E, 0x46, - 0x75, 0xE8, 0x32, 0x23, 0xCD, 0x11, 0xC8, 0x88, 0xF7, 0x00, - 0x11, 0x4C, 0xBD, 0x14, 0x62, 0xC2, 0x4B, 0x83, 0x36, 0xDE, - 0x61, 0x78, 0x7F, 0x09, 0x16, 0x97, 0x98, 0x3D, 0x52, 0x70, - 0x7F, 0xED, 0x86, 0xDB, 0x75, 0x42, 0x52, 0xF3, 0xB1, 0xAE, - 0x70, 0x7F, 0xD3, 0x4C, 0xBD, 0x14, 0x62, 0xC2, 0x4B, 0x83, - 0x36, 0xDE, 0x61, 0x78, 0x7F, 0x09, 0x16, 0x97, 0x98, 0x3D, - 0x52, 0x70, 0x7F, 0xED, 0x86, 0xDB, 0x75, 0x42, 0x52, 0xF3, - 0xB1, 0xAE, 0x70, 0x7F, 0xD3 + 0X30, 0X71, 0X02, 0X01, 0X00, 0X30, 0X08, 0X06, 0X06, 0X2B, + 0XCE, 0X0F, 0X06, 0X07, 0X10, 0X04, 0X62, 0X04, 0X60, 0XFF, + 0X26, 0X56, 0X65, 0XAC, 0X6C, 0X0B, 0X72, 0X2D, 0X8D, 0XB8, + 0X29, 0X4A, 0X15, 0X7E, 0XEF, 0X55, 0XFD, 0XBE, 0XF4, 0XC0, + 0XE6, 0X6F, 0X2B, 0X7A, 0X97, 0X60, 0X51, 0X1C, 0XCB, 0X82, + 0X43, 0X44, 0XDE, 0X14, 0X3D, 0X4F, 0XE7, 0X3C, 0X1C, 0XB3, + 0XBB, 0X9F, 0XE8, 0X9F, 0X8F, 0XA4, 0XAD, 0XB9, 0X52, 0XC1, + 0X31, 0XF7, 0XC1, 0X86, 0X7E, 0X73, 0XFB, 0X9E, 0X72, 0X57, + 0X8A, 0XD7, 0X44, 0X44, 0XDE, 0X14, 0X3D, 0X4F, 0XE7, 0X3C, + 0X1C, 0XB3, 0XBB, 0X9F, 0XE8, 0X9F, 0X8F, 0XA4, 0XAD, 0XB9, + 0X52, 0XC1, 0X31, 0XF7, 0XC1, 0X86, 0X7E, 0X73, 0XFB, 0X9E, + 0X72, 0X57, 0X8A, 0XD7, 0X44 }; static const int sizeof_bench_sphincs_small_level1_key = sizeof(bench_sphincs_small_level1_key); /* certs/sphincs/bench_sphincs_small_level3_key.der */ 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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, 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); /* certs/sphincs/bench_sphincs_small_level5_key.der */ 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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9F, 0X8C, 0XE8, 0X9B, + 0XE8, 0XFA, 0X1E, 0XF0, 0XA1, 0X98, 0XCA, 0X8B, 0X34, 0XD4, + 0X71, 0X53, 0XF0, 0XA7, 0X1D, 0XD6, 0X0D, 0XDF, 0X63, 0X61, + 0XA7, 0X12, 0X80, 0X64, 0XF7, 0X73, 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, + 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