From 1873d5163efb69dc523d7f1f73c7934e5737bc8c Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 30 Dec 2024 06:44:13 -0500 Subject: [PATCH] Consistently use ClassicMcEliece for CMCE parameter names --- src/build-data/oids.txt | 32 ++--- src/lib/asn1/oid_maps.cpp | 66 ++++----- .../classic_mceliece/cmce_parameter_set.cpp | 134 +++++++++--------- .../classic_mceliece/cmce_parameter_set.h | 40 +++--- .../classic_mceliece/cmce_parameters.cpp | 128 ++++++++--------- .../pubkey/classic_mceliece/cmce_parameters.h | 30 ++-- src/lib/pubkey/pk_algs.cpp | 10 +- src/scripts/test_python.py | 2 +- src/tests/data/pubkey/cmce_kat_hashed.vec | 40 +++--- src/tests/data/pubkey/cmce_negative.vec | 4 +- src/tests/test_cmce.cpp | 54 +++---- src/tests/test_ffi.cpp | 32 ++--- 12 files changed, 287 insertions(+), 285 deletions(-) diff --git a/src/build-data/oids.txt b/src/build-data/oids.txt index 94edfc773f6..131dcf09eb0 100644 --- a/src/build-data/oids.txt +++ b/src/build-data/oids.txt @@ -99,24 +99,24 @@ 1.3.6.1.4.1.25258.1.12.3.6 = SphincsPlus-haraka-256f-r3.1 # Classic McEliece OID selection from IETF Hackathon/BouncyCastle for non PC instances -1.3.6.1.4.1.22554.5.1.1 = mceliece348864 -1.3.6.1.4.1.22554.5.1.2 = mceliece348864f -1.3.6.1.4.1.22554.5.1.3 = mceliece460896 -1.3.6.1.4.1.22554.5.1.4 = mceliece460896f -1.3.6.1.4.1.22554.5.1.5 = mceliece6688128 -1.3.6.1.4.1.22554.5.1.6 = mceliece6688128f -1.3.6.1.4.1.22554.5.1.7 = mceliece6960119 -1.3.6.1.4.1.22554.5.1.8 = mceliece6960119f -1.3.6.1.4.1.22554.5.1.9 = mceliece8192128 -1.3.6.1.4.1.22554.5.1.10 = mceliece8192128f +1.3.6.1.4.1.22554.5.1.1 = ClassicMcEliece_348864 +1.3.6.1.4.1.22554.5.1.2 = ClassicMcEliece_348864f +1.3.6.1.4.1.22554.5.1.3 = ClassicMcEliece_460896 +1.3.6.1.4.1.22554.5.1.4 = ClassicMcEliece_460896f +1.3.6.1.4.1.22554.5.1.5 = ClassicMcEliece_6688128 +1.3.6.1.4.1.22554.5.1.6 = ClassicMcEliece_6688128f +1.3.6.1.4.1.22554.5.1.7 = ClassicMcEliece_6960119 +1.3.6.1.4.1.22554.5.1.8 = ClassicMcEliece_6960119f +1.3.6.1.4.1.22554.5.1.9 = ClassicMcEliece_8192128 +1.3.6.1.4.1.22554.5.1.10 = ClassicMcEliece_8192128f # Classic McEliece PC OIDs are currently in Botan's private arc -1.3.6.1.4.1.25258.1.18.1 = mceliece6688128pc -1.3.6.1.4.1.25258.1.18.2 = mceliece6688128pcf -1.3.6.1.4.1.25258.1.18.3 = mceliece6960119pc -1.3.6.1.4.1.25258.1.18.4 = mceliece6960119pcf -1.3.6.1.4.1.25258.1.18.5 = mceliece8192128pc -1.3.6.1.4.1.25258.1.18.6 = mceliece8192128pcf +1.3.6.1.4.1.25258.1.18.1 = ClassicMcEliece_6688128pc +1.3.6.1.4.1.25258.1.18.2 = ClassicMcEliece_6688128pcf +1.3.6.1.4.1.25258.1.18.3 = ClassicMcEliece_6960119pc +1.3.6.1.4.1.25258.1.18.4 = ClassicMcEliece_6960119pcf +1.3.6.1.4.1.25258.1.18.5 = ClassicMcEliece_8192128pc +1.3.6.1.4.1.25258.1.18.6 = ClassicMcEliece_8192128pcf # XMSS 1.3.6.1.4.1.25258.1.5 = XMSS-draft6 diff --git a/src/lib/asn1/oid_maps.cpp b/src/lib/asn1/oid_maps.cpp index 56b02e1c094..5f2c18057ca 100644 --- a/src/lib/asn1/oid_maps.cpp +++ b/src/lib/asn1/oid_maps.cpp @@ -1,7 +1,7 @@ /* * OID maps * -* This file was automatically generated by ./src/scripts/dev_tools/gen_oids.py on 2024-10-18 +* This file was automatically generated by ./src/scripts/dev_tools/gen_oids.py on 2024-12-30 * * All manual edits to this file will be lost. Edit the script * then regenerate this source file. @@ -142,16 +142,16 @@ std::unordered_map OID_Map::load_oid2str_map() { {"1.3.36.3.3.2.8.1.1.9", "brainpool320r1"}, {"1.3.6.1.4.1.11591.15.1", "OpenPGP.Ed25519"}, {"1.3.6.1.4.1.11591.4.11", "Scrypt"}, - {"1.3.6.1.4.1.22554.5.1.1", "mceliece348864"}, - {"1.3.6.1.4.1.22554.5.1.10", "mceliece8192128f"}, - {"1.3.6.1.4.1.22554.5.1.2", "mceliece348864f"}, - {"1.3.6.1.4.1.22554.5.1.3", "mceliece460896"}, - {"1.3.6.1.4.1.22554.5.1.4", "mceliece460896f"}, - {"1.3.6.1.4.1.22554.5.1.5", "mceliece6688128"}, - {"1.3.6.1.4.1.22554.5.1.6", "mceliece6688128f"}, - {"1.3.6.1.4.1.22554.5.1.7", "mceliece6960119"}, - {"1.3.6.1.4.1.22554.5.1.8", "mceliece6960119f"}, - {"1.3.6.1.4.1.22554.5.1.9", "mceliece8192128"}, + {"1.3.6.1.4.1.22554.5.1.1", "ClassicMcEliece_348864"}, + {"1.3.6.1.4.1.22554.5.1.10", "ClassicMcEliece_8192128f"}, + {"1.3.6.1.4.1.22554.5.1.2", "ClassicMcEliece_348864f"}, + {"1.3.6.1.4.1.22554.5.1.3", "ClassicMcEliece_460896"}, + {"1.3.6.1.4.1.22554.5.1.4", "ClassicMcEliece_460896f"}, + {"1.3.6.1.4.1.22554.5.1.5", "ClassicMcEliece_6688128"}, + {"1.3.6.1.4.1.22554.5.1.6", "ClassicMcEliece_6688128f"}, + {"1.3.6.1.4.1.22554.5.1.7", "ClassicMcEliece_6960119"}, + {"1.3.6.1.4.1.22554.5.1.8", "ClassicMcEliece_6960119f"}, + {"1.3.6.1.4.1.22554.5.1.9", "ClassicMcEliece_8192128"}, {"1.3.6.1.4.1.25258.1.10.1", "Dilithium-4x4-AES-r3"}, {"1.3.6.1.4.1.25258.1.10.2", "Dilithium-6x5-AES-r3"}, {"1.3.6.1.4.1.25258.1.10.3", "Dilithium-8x7-AES-r3"}, @@ -189,12 +189,12 @@ std::unordered_map OID_Map::load_oid2str_map() { {"1.3.6.1.4.1.25258.1.17.1", "eFrodoKEM-640-AES"}, {"1.3.6.1.4.1.25258.1.17.2", "eFrodoKEM-976-AES"}, {"1.3.6.1.4.1.25258.1.17.3", "eFrodoKEM-1344-AES"}, - {"1.3.6.1.4.1.25258.1.18.1", "mceliece6688128pc"}, - {"1.3.6.1.4.1.25258.1.18.2", "mceliece6688128pcf"}, - {"1.3.6.1.4.1.25258.1.18.3", "mceliece6960119pc"}, - {"1.3.6.1.4.1.25258.1.18.4", "mceliece6960119pcf"}, - {"1.3.6.1.4.1.25258.1.18.5", "mceliece8192128pc"}, - {"1.3.6.1.4.1.25258.1.18.6", "mceliece8192128pcf"}, + {"1.3.6.1.4.1.25258.1.18.1", "ClassicMcEliece_6688128pc"}, + {"1.3.6.1.4.1.25258.1.18.2", "ClassicMcEliece_6688128pcf"}, + {"1.3.6.1.4.1.25258.1.18.3", "ClassicMcEliece_6960119pc"}, + {"1.3.6.1.4.1.25258.1.18.4", "ClassicMcEliece_6960119pcf"}, + {"1.3.6.1.4.1.25258.1.18.5", "ClassicMcEliece_8192128pc"}, + {"1.3.6.1.4.1.25258.1.18.6", "ClassicMcEliece_8192128pcf"}, {"1.3.6.1.4.1.25258.1.3", "McEliece"}, {"1.3.6.1.4.1.25258.1.5", "XMSS-draft6"}, {"1.3.6.1.4.1.25258.1.6.1", "GOST-34.10-2012-256/SHA-256"}, @@ -378,6 +378,22 @@ std::unordered_map OID_Map::load_str2oid_map() { {"Camellia-256/SIV", OID({1, 3, 6, 1, 4, 1, 25258, 3, 4, 8})}, {"Certificate Comment", OID({2, 16, 840, 1, 113730, 1, 13})}, {"ChaCha20Poly1305", OID({1, 2, 840, 113549, 1, 9, 16, 3, 18})}, + {"ClassicMcEliece_348864", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 1})}, + {"ClassicMcEliece_348864f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 2})}, + {"ClassicMcEliece_460896", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 3})}, + {"ClassicMcEliece_460896f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 4})}, + {"ClassicMcEliece_6688128", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 5})}, + {"ClassicMcEliece_6688128f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 6})}, + {"ClassicMcEliece_6688128pc", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 1})}, + {"ClassicMcEliece_6688128pcf", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 2})}, + {"ClassicMcEliece_6960119", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 7})}, + {"ClassicMcEliece_6960119f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 8})}, + {"ClassicMcEliece_6960119pc", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 3})}, + {"ClassicMcEliece_6960119pcf", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 4})}, + {"ClassicMcEliece_8192128", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 9})}, + {"ClassicMcEliece_8192128f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 10})}, + {"ClassicMcEliece_8192128pc", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 5})}, + {"ClassicMcEliece_8192128pcf", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 6})}, {"Compression.Zlib", OID({1, 2, 840, 113549, 1, 9, 16, 3, 8})}, {"Curve25519", OID({1, 3, 101, 110})}, {"DES/CBC", OID({1, 3, 14, 3, 2, 7})}, @@ -637,22 +653,6 @@ std::unordered_map OID_Map::load_str2oid_map() { {"gost_256B", OID({1, 2, 643, 7, 1, 2, 1, 1, 2})}, {"gost_512A", OID({1, 2, 643, 7, 1, 2, 1, 2, 1})}, {"gost_512B", OID({1, 2, 643, 7, 1, 2, 1, 2, 2})}, - {"mceliece348864", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 1})}, - {"mceliece348864f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 2})}, - {"mceliece460896", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 3})}, - {"mceliece460896f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 4})}, - {"mceliece6688128", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 5})}, - {"mceliece6688128f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 6})}, - {"mceliece6688128pc", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 1})}, - {"mceliece6688128pcf", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 2})}, - {"mceliece6960119", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 7})}, - {"mceliece6960119f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 8})}, - {"mceliece6960119pc", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 3})}, - {"mceliece6960119pcf", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 4})}, - {"mceliece8192128", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 9})}, - {"mceliece8192128f", OID({1, 3, 6, 1, 4, 1, 22554, 5, 1, 10})}, - {"mceliece8192128pc", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 5})}, - {"mceliece8192128pcf", OID({1, 3, 6, 1, 4, 1, 25258, 1, 18, 6})}, {"numsp256d1", OID({1, 3, 6, 1, 4, 1, 25258, 4, 1})}, {"numsp384d1", OID({1, 3, 6, 1, 4, 1, 25258, 4, 2})}, {"numsp512d1", OID({1, 3, 6, 1, 4, 1, 25258, 4, 3})}, diff --git a/src/lib/pubkey/classic_mceliece/cmce_parameter_set.cpp b/src/lib/pubkey/classic_mceliece/cmce_parameter_set.cpp index 0306cd8e2e6..8b097a64767 100644 --- a/src/lib/pubkey/classic_mceliece/cmce_parameter_set.cpp +++ b/src/lib/pubkey/classic_mceliece/cmce_parameter_set.cpp @@ -8,98 +8,100 @@ #include +#include + namespace Botan { -Classic_McEliece_Parameter_Set Classic_McEliece_Parameter_Set::from_string(std::string_view param_name) { +Classic_McEliece_Parameter_Set Classic_McEliece_Parameter_Set::from_string(std::string_view nm) { Code code = [&] { - if(param_name == "mceliece348864") { - return mceliece348864; + if(nm == "ClassicMcEliece_348864" || nm == "348864") { + return ClassicMcEliece_348864; } - if(param_name == "mceliece348864f") { - return mceliece348864f; + if(nm == "ClassicMcEliece_348864f" || nm == "348864f") { + return ClassicMcEliece_348864f; } - if(param_name == "mceliece460896") { - return mceliece460896; + if(nm == "ClassicMcEliece_460896" || nm == "460896") { + return ClassicMcEliece_460896; } - if(param_name == "mceliece460896f") { - return mceliece460896f; + if(nm == "ClassicMcEliece_460896f" || nm == "460896f") { + return ClassicMcEliece_460896f; } - if(param_name == "mceliece6688128") { - return mceliece6688128; + if(nm == "ClassicMcEliece_6688128" || nm == "6688128") { + return ClassicMcEliece_6688128; } - if(param_name == "mceliece6688128f") { - return mceliece6688128f; + if(nm == "ClassicMcEliece_6688128f" || nm == "6688128f") { + return ClassicMcEliece_6688128f; } - if(param_name == "mceliece6688128pc") { - return mceliece6688128pc; + if(nm == "ClassicMcEliece_6688128pc" || nm == "6688128pc") { + return ClassicMcEliece_6688128pc; } - if(param_name == "mceliece6688128pcf") { - return mceliece6688128pcf; + if(nm == "ClassicMcEliece_6688128pcf" || nm == "6688128pcf") { + return ClassicMcEliece_6688128pcf; } - if(param_name == "mceliece6960119") { - return mceliece6960119; + if(nm == "ClassicMcEliece_6960119" || nm == "6960119") { + return ClassicMcEliece_6960119; } - if(param_name == "mceliece6960119f") { - return mceliece6960119f; + if(nm == "ClassicMcEliece_6960119f" || nm == "6960119f") { + return ClassicMcEliece_6960119f; } - if(param_name == "mceliece6960119pc") { - return mceliece6960119pc; + if(nm == "ClassicMcEliece_6960119pc" || nm == "6960119pc") { + return ClassicMcEliece_6960119pc; } - if(param_name == "mceliece6960119pcf") { - return mceliece6960119pcf; + if(nm == "ClassicMcEliece_6960119pcf" || nm == "6960119pcf") { + return ClassicMcEliece_6960119pcf; } - if(param_name == "mceliece8192128") { - return mceliece8192128; + if(nm == "ClassicMcEliece_8192128" || nm == "8192128") { + return ClassicMcEliece_8192128; } - if(param_name == "mceliece8192128f") { - return mceliece8192128f; + if(nm == "ClassicMcEliece_8192128f" || nm == "8192128f") { + return ClassicMcEliece_8192128f; } - if(param_name == "mceliece8192128pc") { - return mceliece8192128pc; + if(nm == "ClassicMcEliece_8192128pc" || nm == "8192128pc") { + return ClassicMcEliece_8192128pc; } - if(param_name == "mceliece8192128pcf") { - return mceliece8192128pcf; + if(nm == "ClassicMcEliece_8192128pcf" || nm == "8192128pcf") { + return ClassicMcEliece_8192128pcf; } - throw Decoding_Error("Cannot convert string to CMCE parameter set"); + throw Invalid_Argument(fmt("Cannot convert '{}' to ClassicMcEliece parameter set", nm)); }(); return Classic_McEliece_Parameter_Set(code); } std::string Classic_McEliece_Parameter_Set::to_string() const { switch(m_code) { - case mceliece348864: - return "mceliece348864"; - case mceliece348864f: - return "mceliece348864f"; - case mceliece460896: - return "mceliece460896"; - case mceliece460896f: - return "mceliece460896f"; - case mceliece6688128: - return "mceliece6688128"; - case mceliece6688128f: - return "mceliece6688128f"; - case mceliece6688128pc: - return "mceliece6688128pc"; - case mceliece6688128pcf: - return "mceliece6688128pcf"; - case mceliece6960119: - return "mceliece6960119"; - case mceliece6960119f: - return "mceliece6960119f"; - case mceliece6960119pc: - return "mceliece6960119pc"; - case mceliece6960119pcf: - return "mceliece6960119pcf"; - case mceliece8192128: - return "mceliece8192128"; - case mceliece8192128f: - return "mceliece8192128f"; - case mceliece8192128pc: - return "mceliece8192128pc"; - case mceliece8192128pcf: - return "mceliece8192128pcf"; + case ClassicMcEliece_348864: + return "ClassicMcEliece_348864"; + case ClassicMcEliece_348864f: + return "ClassicMcEliece_348864f"; + case ClassicMcEliece_460896: + return "ClassicMcEliece_460896"; + case ClassicMcEliece_460896f: + return "ClassicMcEliece_460896f"; + case ClassicMcEliece_6688128: + return "ClassicMcEliece_6688128"; + case ClassicMcEliece_6688128f: + return "ClassicMcEliece_6688128f"; + case ClassicMcEliece_6688128pc: + return "ClassicMcEliece_6688128pc"; + case ClassicMcEliece_6688128pcf: + return "ClassicMcEliece_6688128pcf"; + case ClassicMcEliece_6960119: + return "ClassicMcEliece_6960119"; + case ClassicMcEliece_6960119f: + return "ClassicMcEliece_6960119f"; + case ClassicMcEliece_6960119pc: + return "ClassicMcEliece_6960119pc"; + case ClassicMcEliece_6960119pcf: + return "ClassicMcEliece_6960119pcf"; + case ClassicMcEliece_8192128: + return "ClassicMcEliece_8192128"; + case ClassicMcEliece_8192128f: + return "ClassicMcEliece_8192128f"; + case ClassicMcEliece_8192128pc: + return "ClassicMcEliece_8192128pc"; + case ClassicMcEliece_8192128pcf: + return "ClassicMcEliece_8192128pcf"; } BOTAN_ASSERT_UNREACHABLE(); } diff --git a/src/lib/pubkey/classic_mceliece/cmce_parameter_set.h b/src/lib/pubkey/classic_mceliece/cmce_parameter_set.h index 28d514f6d7e..de2be49bf47 100644 --- a/src/lib/pubkey/classic_mceliece/cmce_parameter_set.h +++ b/src/lib/pubkey/classic_mceliece/cmce_parameter_set.h @@ -26,26 +26,26 @@ namespace Botan { class BOTAN_PUBLIC_API(3, 4) Classic_McEliece_Parameter_Set { public: enum class Code { - mceliece348864, // NIST - mceliece348864f, // NIST - - mceliece460896, // NIST - mceliece460896f, // NIST - - mceliece6688128, // ISO + NIST - mceliece6688128f, // ISO + NIST - mceliece6688128pc, // ISO - mceliece6688128pcf, // ISO - - mceliece6960119, // ISO + NIST - mceliece6960119f, // ISO + NIST - mceliece6960119pc, // ISO - mceliece6960119pcf, // ISO - - mceliece8192128, // ISO + NIST - mceliece8192128f, // ISO + NIST - mceliece8192128pc, // ISO - mceliece8192128pcf, // ISO + ClassicMcEliece_348864, // NIST + ClassicMcEliece_348864f, // NIST + + ClassicMcEliece_460896, // NIST + ClassicMcEliece_460896f, // NIST + + ClassicMcEliece_6688128, // ISO + NIST + ClassicMcEliece_6688128f, // ISO + NIST + ClassicMcEliece_6688128pc, // ISO + ClassicMcEliece_6688128pcf, // ISO + + ClassicMcEliece_6960119, // ISO + NIST + ClassicMcEliece_6960119f, // ISO + NIST + ClassicMcEliece_6960119pc, // ISO + ClassicMcEliece_6960119pcf, // ISO + + ClassicMcEliece_8192128, // ISO + NIST + ClassicMcEliece_8192128f, // ISO + NIST + ClassicMcEliece_8192128pc, // ISO + ClassicMcEliece_8192128pcf, // ISO }; using enum Code; diff --git a/src/lib/pubkey/classic_mceliece/cmce_parameters.cpp b/src/lib/pubkey/classic_mceliece/cmce_parameters.cpp index 2303739a7b3..8790e52b3a0 100644 --- a/src/lib/pubkey/classic_mceliece/cmce_parameters.cpp +++ b/src/lib/pubkey/classic_mceliece/cmce_parameters.cpp @@ -15,24 +15,24 @@ namespace { CmceGfMod determine_poly_f(Classic_McEliece_Parameter_Set param_set) { switch(param_set.code()) { - case Classic_McEliece_Parameter_Set::mceliece348864: - case Classic_McEliece_Parameter_Set::mceliece348864f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_348864: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f: // z^12 + z^3 + 1 return CmceGfMod(0b0001000000001001); - case Classic_McEliece_Parameter_Set::mceliece460896: - case Classic_McEliece_Parameter_Set::mceliece460896f: - case Classic_McEliece_Parameter_Set::mceliece6688128: - case Classic_McEliece_Parameter_Set::mceliece6688128f: - case Classic_McEliece_Parameter_Set::mceliece6688128pc: - case Classic_McEliece_Parameter_Set::mceliece6688128pcf: - case Classic_McEliece_Parameter_Set::mceliece6960119: - case Classic_McEliece_Parameter_Set::mceliece6960119f: - case Classic_McEliece_Parameter_Set::mceliece6960119pc: - case Classic_McEliece_Parameter_Set::mceliece6960119pcf: - case Classic_McEliece_Parameter_Set::mceliece8192128: - case Classic_McEliece_Parameter_Set::mceliece8192128f: - case Classic_McEliece_Parameter_Set::mceliece8192128pc: - case Classic_McEliece_Parameter_Set::mceliece8192128pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_460896: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf: // z^12 + z^3 + 1 return CmceGfMod(0b0010000000011011); } @@ -43,16 +43,16 @@ Classic_McEliece_Polynomial_Ring determine_poly_ring(Classic_McEliece_Parameter_ CmceGfMod poly_f = determine_poly_f(param_set); switch(param_set.code()) { - case Classic_McEliece_Parameter_Set::mceliece348864: - case Classic_McEliece_Parameter_Set::mceliece348864f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_348864: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f: // y^64 + y^3 + y + z return {{{3, Classic_McEliece_GF(CmceGfElem(1), poly_f)}, {1, Classic_McEliece_GF(CmceGfElem(1), poly_f)}, {0, Classic_McEliece_GF(CmceGfElem(2), poly_f)}}, poly_f, 64}; - case Classic_McEliece_Parameter_Set::mceliece460896: - case Classic_McEliece_Parameter_Set::mceliece460896f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_460896: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f: // y^96 + y^10 + y^9 + y^6 + 1 return {{{10, Classic_McEliece_GF(CmceGfElem(1), poly_f)}, {9, Classic_McEliece_GF(CmceGfElem(1), poly_f)}, @@ -60,10 +60,10 @@ Classic_McEliece_Polynomial_Ring determine_poly_ring(Classic_McEliece_Parameter_ {0, Classic_McEliece_GF(CmceGfElem(1), poly_f)}}, poly_f, 96}; - case Classic_McEliece_Parameter_Set::mceliece6960119: - case Classic_McEliece_Parameter_Set::mceliece6960119f: - case Classic_McEliece_Parameter_Set::mceliece6960119pc: - case Classic_McEliece_Parameter_Set::mceliece6960119pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf: // y^119 + y^8 + 1 // clang-format off return {{{8, Classic_McEliece_GF(CmceGfElem(1), poly_f)}, @@ -71,14 +71,14 @@ Classic_McEliece_Polynomial_Ring determine_poly_ring(Classic_McEliece_Parameter_ poly_f, 119}; // clang-format on - case Classic_McEliece_Parameter_Set::mceliece6688128: - case Classic_McEliece_Parameter_Set::mceliece6688128f: - case Classic_McEliece_Parameter_Set::mceliece6688128pc: - case Classic_McEliece_Parameter_Set::mceliece6688128pcf: - case Classic_McEliece_Parameter_Set::mceliece8192128: - case Classic_McEliece_Parameter_Set::mceliece8192128f: - case Classic_McEliece_Parameter_Set::mceliece8192128pc: - case Classic_McEliece_Parameter_Set::mceliece8192128pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf: // y^128 + y^7 + y^2 + y + 1 return {{{7, Classic_McEliece_GF(CmceGfElem(1), poly_f)}, {2, Classic_McEliece_GF(CmceGfElem(1), poly_f)}, @@ -96,30 +96,30 @@ Classic_McEliece_Parameters Classic_McEliece_Parameters::create(Classic_McEliece auto poly_ring = determine_poly_ring(set); switch(set.code()) { - case Classic_McEliece_Parameter_Set::mceliece348864: - case Classic_McEliece_Parameter_Set::mceliece348864f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_348864: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f: return Classic_McEliece_Parameters(set, 12, 3488, std::move(poly_ring)); - case Classic_McEliece_Parameter_Set::mceliece460896: - case Classic_McEliece_Parameter_Set::mceliece460896f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_460896: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f: return Classic_McEliece_Parameters(set, 13, 4608, std::move(poly_ring)); - case Classic_McEliece_Parameter_Set::mceliece6688128: - case Classic_McEliece_Parameter_Set::mceliece6688128f: - case Classic_McEliece_Parameter_Set::mceliece6688128pc: - case Classic_McEliece_Parameter_Set::mceliece6688128pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf: return Classic_McEliece_Parameters(set, 13, 6688, std::move(poly_ring)); - case Classic_McEliece_Parameter_Set::mceliece6960119: - case Classic_McEliece_Parameter_Set::mceliece6960119f: - case Classic_McEliece_Parameter_Set::mceliece6960119pc: - case Classic_McEliece_Parameter_Set::mceliece6960119pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf: return Classic_McEliece_Parameters(set, 13, 6960, std::move(poly_ring)); - case Classic_McEliece_Parameter_Set::mceliece8192128: - case Classic_McEliece_Parameter_Set::mceliece8192128f: - case Classic_McEliece_Parameter_Set::mceliece8192128pc: - case Classic_McEliece_Parameter_Set::mceliece8192128pcf: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc: + case Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf: return Classic_McEliece_Parameters(set, 13, 8192, std::move(poly_ring)); } BOTAN_ASSERT_UNREACHABLE(); @@ -151,26 +151,26 @@ size_t Classic_McEliece_Parameters::estimated_strength() const { // is used as the overall security strength estimate. The strength is capped at 256, since the // seed is only 256 bits long. switch(m_set.code()) { - case Botan::Classic_McEliece_Parameter_Set::mceliece348864: - case Botan::Classic_McEliece_Parameter_Set::mceliece348864f: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f: return 140; - case Botan::Classic_McEliece_Parameter_Set::mceliece460896: - case Botan::Classic_McEliece_Parameter_Set::mceliece460896f: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f: return 179; - case Botan::Classic_McEliece_Parameter_Set::mceliece6688128: - case Botan::Classic_McEliece_Parameter_Set::mceliece6688128f: - case Botan::Classic_McEliece_Parameter_Set::mceliece6688128pc: - case Botan::Classic_McEliece_Parameter_Set::mceliece6688128pcf: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf: return 246; - case Botan::Classic_McEliece_Parameter_Set::mceliece6960119: - case Botan::Classic_McEliece_Parameter_Set::mceliece6960119f: - case Botan::Classic_McEliece_Parameter_Set::mceliece6960119pc: - case Botan::Classic_McEliece_Parameter_Set::mceliece6960119pcf: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf: return 245; - case Botan::Classic_McEliece_Parameter_Set::mceliece8192128: - case Botan::Classic_McEliece_Parameter_Set::mceliece8192128f: - case Botan::Classic_McEliece_Parameter_Set::mceliece8192128pc: - case Botan::Classic_McEliece_Parameter_Set::mceliece8192128pcf: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc: + case Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf: return 256; // 275 in the document. Capped at 256 because of the seed length. } BOTAN_ASSERT_UNREACHABLE(); diff --git a/src/lib/pubkey/classic_mceliece/cmce_parameters.h b/src/lib/pubkey/classic_mceliece/cmce_parameters.h index 3dcc08111e9..bf4cf8d4f89 100644 --- a/src/lib/pubkey/classic_mceliece/cmce_parameters.h +++ b/src/lib/pubkey/classic_mceliece/cmce_parameters.h @@ -57,27 +57,27 @@ class BOTAN_TEST_API Classic_McEliece_Parameters final { * @returns true iff the instance is a plaintext confirmation (PC) instance. */ bool is_pc() const { - return (m_set == Classic_McEliece_Parameter_Set::mceliece6688128pc) || - (m_set == Classic_McEliece_Parameter_Set::mceliece6688128pcf) || - (m_set == Classic_McEliece_Parameter_Set::mceliece6960119pc) || - (m_set == Classic_McEliece_Parameter_Set::mceliece6960119pcf) || - (m_set == Classic_McEliece_Parameter_Set::mceliece8192128pc) || - (m_set == Classic_McEliece_Parameter_Set::mceliece8192128pcf); + return (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf); } /** * @returns true iff the instance is a fast (F) instance, i.e. if the semi-systematic * matrix creation is used. - */ +` */ bool is_f() const { - return (m_set == Classic_McEliece_Parameter_Set::mceliece348864f) || - (m_set == Classic_McEliece_Parameter_Set::mceliece460896f) || - (m_set == Classic_McEliece_Parameter_Set::mceliece6688128f) || - (m_set == Classic_McEliece_Parameter_Set::mceliece6688128pcf) || - (m_set == Classic_McEliece_Parameter_Set::mceliece6960119f) || - (m_set == Classic_McEliece_Parameter_Set::mceliece6960119pcf) || - (m_set == Classic_McEliece_Parameter_Set::mceliece8192128f) || - (m_set == Classic_McEliece_Parameter_Set::mceliece8192128pcf); + return (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f) || + (m_set == Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf); } /** diff --git a/src/lib/pubkey/pk_algs.cpp b/src/lib/pubkey/pk_algs.cpp index 2046ad1efa9..dd4b6a3bb71 100644 --- a/src/lib/pubkey/pk_algs.cpp +++ b/src/lib/pubkey/pk_algs.cpp @@ -270,8 +270,8 @@ std::unique_ptr load_public_key(const AlgorithmIdentifier& alg_id, } #endif -#if defined(BOTAN_HAS_CLASSICMCELIECE) || defined(BOTAN_HAS_CLASSICMCELIECE) - if(alg_name.starts_with("mceliece")) { +#if defined(BOTAN_HAS_CLASSICMCELIECE) + if(alg_name.starts_with("ClassicMcEliece")) { return std::make_unique(alg_id, key_bits); } #endif @@ -429,8 +429,8 @@ std::unique_ptr load_private_key(const AlgorithmIdentifier& alg_id, } #endif -#if defined(BOTAN_HAS_CLASSICMCELIECE) || defined(BOTAN_HAS_CLASSICMCELIECE) - if(alg_name.starts_with("mceliece")) { +#if defined(BOTAN_HAS_CLASSICMCELIECE) + if(alg_name.starts_with("ClassicMcEliece")) { return std::make_unique(alg_id, key_bits); } #endif @@ -533,7 +533,7 @@ std::unique_ptr create_private_key(std::string_view alg_name, #endif #if defined(BOTAN_HAS_CLASSICMCELIECE) if(alg_name == "ClassicMcEliece") { - auto cmce_params_set = params.empty() ? Classic_McEliece_Parameter_Set::mceliece6960119f + auto cmce_params_set = params.empty() ? Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f : Classic_McEliece_Parameter_Set::from_string(params); return std::make_unique(rng, cmce_params_set); } diff --git a/src/scripts/test_python.py b/src/scripts/test_python.py index cfe5019c64a..3a8dda7b3b8 100644 --- a/src/scripts/test_python.py +++ b/src/scripts/test_python.py @@ -1019,7 +1019,7 @@ def test_frodokem_raw_keys(self): self.assertEqual(pk_read.to_raw(), pk_bits) def test_classic_mceliece_raw_keys(self): - cmce_mode = "mceliece348864f" + cmce_mode = "348864f" sk = botan.PrivateKey.create("ClassicMcEliece", cmce_mode, botan.RandomNumberGenerator("user")) pk = sk.get_public_key() diff --git a/src/tests/data/pubkey/cmce_kat_hashed.vec b/src/tests/data/pubkey/cmce_kat_hashed.vec index 5d5f6852b31..ce3e167b6eb 100644 --- a/src/tests/data/pubkey/cmce_kat_hashed.vec +++ b/src/tests/data/pubkey/cmce_kat_hashed.vec @@ -2,14 +2,14 @@ # The plaintext confirmation (pc) KATs are created using a modified reference implementation # The public and secret keys are hashed via SHAKE256(512) -[mceliece348864] +[348864] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = B4F9FF1E4390E3BE0BBCEBFF9A525AE83B191211896AA8786CE8BC511C9F78C3 PK = 2615e458cdda9626d09719ae81a1abf2ca9295d51b256843eb73faead8bcad60ee4fbe5419b2c906ae00d9c60328ff835697b19f78a6974269e8dd7c89027ca8 SK = e7a139f9670fff672f75b37b303a289fa45e50acb038d43f655a475053d130334713d965f0c55741d1d866321a17b7918b759ceb235be5368844ad532264b568 CT = DEF61908A70A3099E45B4D5D91957ADE70F571D210D525D655DB7294515F91D97795F2353615BC7CDF13502181E5BCC8C9ABFEF31819D66DD2760363694F789602264A3E24445681A0183CE343A2264FDFF96C82AB318AE888D105D52D59BC1B -[mceliece348864f] +[348864f] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 4B5EA75DD51BE56BE739F6EC6BABC2CBE538683303B05934D33D93256D1AB6EF PK = 77bdeafa05a162bc2ceb46b8e548022684eaef422e6ce123cb990edf44093fd225dc0d4045be3162c8f7062f545217a2858b41c092c915d5f15b05954c0360dd @@ -17,7 +17,7 @@ SK = 3617d714cd395b19d4f08c6bc255666444c3f40a07f02d32abe725db1fbb7db2ef9b3e17f72 CT = E205BB2814DED1582864F2B1D2A26397411EE4E61F6998FF61CD55E4C4FB35AB99788D00F42D2D3B79B0820035749776CAA82730B1EBE2B81230424FCBCB8B5A804B0FA3025B108175456F80F4ABD1786C5DB02C6564333DE9FE67ED4A92D6FE # TODO: Not standardized -# [mceliece348864pc] +# [348864pc] # Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 # SS = 56EA8D2982F408DF1DE8465FFD9A77DE027CC22374C007809F3691D97613812C # PK = 2615e458cdda9626d09719ae81a1abf2ca9295d51b256843eb73faead8bcad60ee4fbe5419b2c906ae00d9c60328ff835697b19f78a6974269e8dd7c89027ca8 @@ -25,21 +25,21 @@ CT = E205BB2814DED1582864F2B1D2A26397411EE4E61F6998FF61CD55E4C4FB35AB99788D00F42 # CT = DEF61908A70A3099E45B4D5D91957ADE70F571D210D525D655DB7294515F91D97795F2353615BC7CDF13502181E5BCC8C9ABFEF31819D66DD2760363694F789602264A3E24445681A0183CE343A2264FDFF96C82AB318AE888D105D52D59BC1BB2A44DB7A3CF1FBFFFEB7E0625701D97B78638E8ECC3E91FEF7327CD118397C0 # TODO: Not standardized -# [mceliece348864pcf] +# [348864pcf] # Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 # SS = 5EA83EC4E9A96CC843CDDD0B9133134FB59EC348EB53440844A2C6D634FE677C # PK = 77bdeafa05a162bc2ceb46b8e548022684eaef422e6ce123cb990edf44093fd225dc0d4045be3162c8f7062f545217a2858b41c092c915d5f15b05954c0360dd # SK = 3617d714cd395b19d4f08c6bc255666444c3f40a07f02d32abe725db1fbb7db2ef9b3e17f723c5f20c8b1e256738383442e634111320fb751f44b8fe858a1d6b # CT = E205BB2814DED1582864F2B1D2A26397411EE4E61F6998FF61CD55E4C4FB35AB99788D00F42D2D3B79B0820035749776CAA82730B1EBE2B81230424FCBCB8B5A804B0FA3025B108175456F80F4ABD1786C5DB02C6564333DE9FE67ED4A92D6FEB2A44DB7A3CF1FBFFFEB7E0625701D97B78638E8ECC3E91FEF7327CD118397C0 -[mceliece460896] +[460896] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 132D477D0C24306181C6AD01590D39BE9B2404ED32CCBE0EB1F169680212CC1C PK = 9b3fdd46b5c7bd7aa0c637b37675af5cc376a6f7fcf0bde389c8cedaa764913a0c3a22044e70b56f54f456db717f985d3f3894d65ff2010d7727b3ab8c2e01ed SK = 1b3274243449643ed4d7cb4364cd094a3f602a9c3d9762896d215df673ee3460ae8dd85022d217bef729e5eb279f2e6c40745e38ef2c4db3d70de1cd1489e573 CT = CF78C42A38795E0F5D6BAC38ACDEE6C4C9536F93BCC32E08B8CE0B886E737AA5AD51CC0E2E5B9176B67F0327EA117334DCD5664ADCFFB39F1932C498B210A56EB5C9E9C7C5DB03DC46C5D2450D1F05C152533BE30AA544F20FF11CAC1FFEBB919D69B033642AC0ABC1C174AFCBE9F22433A5D3E2048621A7982CC08D5D9E37BC65ABE96DF8A651758894B6E58A34E42CB82798BE3FD7B3D96DE27E65 -[mceliece460896f] +[460896f] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 89F6BDB539A46E0DF0D8BE3BEDABCF11A1D0C8F68E707F97081826B5A78A7EA5 PK = ef60b9e0d9b8b34ec6001c4711d66daeadf41198746869b10baf63c0e5a24ac184b5a1cc595c56bdb696651032cbcf038cd2da5da5448cb9bdcfe42cf945ae61 @@ -47,7 +47,7 @@ SK = e51b4f6e8c8e61d3b9c751fde190b17ba899f96803f73b85613d62a650492af4c7829341bef CT = BCF3C98E2EC96F127540B844F4DF0B176E2460C97D6EB82423B3833AEFF0680FC4B3F758E3A6FA03A23D8419CA0B464191AB245CA5C7E112DF24FCE728C40B414DA2F6B058796774DA463966AC5FD21476350E46C3CCD07A317A33DC29132809BAA255A41D6456D01301AC08C94B2D57148CEA41E7AFE036F17D3CE62F46EC31C7FEB07DED1767F861389EC89180E107698AFAFA0976381F04A0CA06 # TODO: Not standardized -# [mceliece460896pc] +# [460896pc] # Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 # SS = F6EB7975CC7AD7438DBE220C72DE9FDB7717161D8A6AA461666B767455847EE9 # PK = 9b3fdd46b5c7bd7aa0c637b37675af5cc376a6f7fcf0bde389c8cedaa764913a0c3a22044e70b56f54f456db717f985d3f3894d65ff2010d7727b3ab8c2e01ed @@ -55,91 +55,91 @@ CT = BCF3C98E2EC96F127540B844F4DF0B176E2460C97D6EB82423B3833AEFF0680FC4B3F758E3A # CT = CF78C42A38795E0F5D6BAC38ACDEE6C4C9536F93BCC32E08B8CE0B886E737AA5AD51CC0E2E5B9176B67F0327EA117334DCD5664ADCFFB39F1932C498B210A56EB5C9E9C7C5DB03DC46C5D2450D1F05C152533BE30AA544F20FF11CAC1FFEBB919D69B033642AC0ABC1C174AFCBE9F22433A5D3E2048621A7982CC08D5D9E37BC65ABE96DF8A651758894B6E58A34E42CB82798BE3FD7B3D96DE27E651585121A060E712178A6218AF3907BC3F8BCDE02E8EAF5769C9E790274267B37 # TODO: Not standardized -# [mceliece460896pcf] +# [460896pcf] # Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 # SS = 5ADC9C0EE763A675F49DD50B9B59C9C6F920D6B9BD298F6106A40E19B5CAD2AC # PK = ef60b9e0d9b8b34ec6001c4711d66daeadf41198746869b10baf63c0e5a24ac184b5a1cc595c56bdb696651032cbcf038cd2da5da5448cb9bdcfe42cf945ae61 # SK = e51b4f6e8c8e61d3b9c751fde190b17ba899f96803f73b85613d62a650492af4c7829341befee710105ed5713f01a5035ed9b6aed4dfcb94c818c680c8466778 # CT = BCF3C98E2EC96F127540B844F4DF0B176E2460C97D6EB82423B3833AEFF0680FC4B3F758E3A6FA03A23D8419CA0B464191AB245CA5C7E112DF24FCE728C40B414DA2F6B058796774DA463966AC5FD21476350E46C3CCD07A317A33DC29132809BAA255A41D6456D01301AC08C94B2D57148CEA41E7AFE036F17D3CE62F46EC31C7FEB07DED1767F861389EC89180E107698AFAFA0976381F04A0CA061585121A060E712178A6218AF3907BC3F8BCDE02E8EAF5769C9E790274267B37 -[mceliece6688128] +[6688128] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 7B35200A8387A2BB376394A68473E7ABE5CE392484DABE6C1EF0EE2CD9F68022 PK = 46489d7bd19b860311fdb17693b920ebd58e356ca01a2c157e00c15fe2be6e0ceac35f767b812464ce9f14a87f4b5d0d1cb8ae5c7daed6a952d3eee732ea60f7 SK = 024c1f80388fa4f60dd19e12eef03f1435cd173b891dfdd4586fb75eecfde6fb1868b979485268df3c075f2faf248b8e160606252b45ccd9a396316a00fb8ec0 CT = 01278F7400972FD05AA6368A4F8662497A5A31A3E968BF81B49EBDFB8331769EA1BB5275AD46D33F8D6624C2F305F961DC8812850B20C2FE3C7E8FB0393BBBFFFC0458A01765EC519AB332DA952047B8A87C618D3BF28046B94F82872A75D1C090DBE768168DF6D7D6755FAFB5AE050AE520BF7ED641C90161DFB70E4A5EF9A8D64856CAC821D98B00E8145D3462A4DB6CF2E0C002DBA11257D7716E22F18F8E28113CDF5FE7581CC82854165AB93E36D4080F8E7B8116667E9C12D515A443EA002E609C6F5EE839FF282D8EAAF6BB8C -[mceliece6688128f] +[6688128f] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 29F45674CFB52E295CD31E5303B7387515699A764777742B5A487798D41218C8 PK = 0c453cc87eb310694cad01065624cdf723b42b7ffc7aa72afa86956013427e83c23c1061ed9c8393e07e37b2186286a096140b2e571deaf4d037deafb41d7235 SK = 9c02fbffd0401c9dcae1a977cd0d52d59178357fcc055e2ba5c6691bb9fbcd3cf7e3d6ccc3ca23213f6cdefb4823e592dff809e1ea8df55f78636da17c8cfd78 CT = 640B4DA81C3198D4707E02CAD713E8EB6BE431076E3EE7D6AA5323A9C551FEFE8BDC978052A55244D9347C2DB4A5EF76C6FFF4EE3F3E973ACBD58C0E03665DAF1857B2987CF463994CC31E95645F81CF2E18F7D5EBBC1212689B6F8765692DDD0F7852FACED8471BDA55737ED4E3129ADE84E246C20D02780D590D47D6D90BB2A6FA7141B72290DB4EE1478E09B1B48B7D8CCE4F37E329A1ED8F9BBAC4DAC6040358CED8B4B96289AB5BE27A95FB35A0D603DCC7E94D8C9A9728A3896D1EE556F5E185DC542DA1CB07A7480D5618D647 -[mceliece6688128pc] +[6688128pc] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 18A3E9906E03926AA87E0E910C570F5874549B0B1DE9E60D50C4031B5EB0B0F6 PK = 46489d7bd19b860311fdb17693b920ebd58e356ca01a2c157e00c15fe2be6e0ceac35f767b812464ce9f14a87f4b5d0d1cb8ae5c7daed6a952d3eee732ea60f7 SK = 024c1f80388fa4f60dd19e12eef03f1435cd173b891dfdd4586fb75eecfde6fb1868b979485268df3c075f2faf248b8e160606252b45ccd9a396316a00fb8ec0 CT = 01278F7400972FD05AA6368A4F8662497A5A31A3E968BF81B49EBDFB8331769EA1BB5275AD46D33F8D6624C2F305F961DC8812850B20C2FE3C7E8FB0393BBBFFFC0458A01765EC519AB332DA952047B8A87C618D3BF28046B94F82872A75D1C090DBE768168DF6D7D6755FAFB5AE050AE520BF7ED641C90161DFB70E4A5EF9A8D64856CAC821D98B00E8145D3462A4DB6CF2E0C002DBA11257D7716E22F18F8E28113CDF5FE7581CC82854165AB93E36D4080F8E7B8116667E9C12D515A443EA002E609C6F5EE839FF282D8EAAF6BB8CEA79099D6282BAD1AF5B0CA919D112A35B12FD483FA90F9FD8B72D15E668E442 -[mceliece6688128pcf] +[6688128pcf] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = B954FAD8A4BD4905AD0D2D30E1AF7A7ECD705B94F7BAA713FFEA1583C96DE70F PK = 0c453cc87eb310694cad01065624cdf723b42b7ffc7aa72afa86956013427e83c23c1061ed9c8393e07e37b2186286a096140b2e571deaf4d037deafb41d7235 SK = 9c02fbffd0401c9dcae1a977cd0d52d59178357fcc055e2ba5c6691bb9fbcd3cf7e3d6ccc3ca23213f6cdefb4823e592dff809e1ea8df55f78636da17c8cfd78 CT = 640B4DA81C3198D4707E02CAD713E8EB6BE431076E3EE7D6AA5323A9C551FEFE8BDC978052A55244D9347C2DB4A5EF76C6FFF4EE3F3E973ACBD58C0E03665DAF1857B2987CF463994CC31E95645F81CF2E18F7D5EBBC1212689B6F8765692DDD0F7852FACED8471BDA55737ED4E3129ADE84E246C20D02780D590D47D6D90BB2A6FA7141B72290DB4EE1478E09B1B48B7D8CCE4F37E329A1ED8F9BBAC4DAC6040358CED8B4B96289AB5BE27A95FB35A0D603DCC7E94D8C9A9728A3896D1EE556F5E185DC542DA1CB07A7480D5618D647EA79099D6282BAD1AF5B0CA919D112A35B12FD483FA90F9FD8B72D15E668E442 -[mceliece6960119] +[6960119] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = ACE16B9D437E56401128EDE4EE3A1C45CFE13D8E8288A3754DB4D9B78C5A3DDF PK = 52244c54404fa392d586faec5a55ebe48c78386a3efce108684b89cc9b9c173a57ccfd6748712fcb6226f7a2add4506e1483107b88172e88589dfdaecd3a0948 SK = 53ca3551c31cd51be0074fc928264765de6bdef00810fc6bdb63ccd69d9e15b168c45a9dfce7bb48dbb131bbe772371b100285d2b282bad4f50b328b81e84826 CT = 63C39D29314866A0FE528B3D5DE37D5C6F72279EE711036198B0C2CA1F293D3541E0D1467D63D2E5C92B8060001CF002017F60B954C5DC457BA63C59BBE330BB66BC8726E605ACD0E90CD7167376F68CC071D4F931349564EF28D7EAB3D1FF61563EE1DEFD95A548004979736AB1B39BE08D57A49F39988F23574A5A06FC4C317F08C1B842EF844773BE74701E57EC91107DE40C6EEB222630621A6FBF2A4CB8CCB9C395ABD85FDC03C0FBE0E56EC9F7052B90608E21653FA2DE1AD62C68C2656C06 -[mceliece6960119f] +[6960119f] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 2FDCA51B72431A9534E670D9ED6C8C085D57AA409C41E21668E03ED0C569BA43 PK = da30411922f1c72600f5e5846f6d0815f41fee4aed87226e61a6d8c28045fe332859f24e9245f095f253ae30ac70b220436ee21d14f58859aa5da5c0fa61b8be SK = 0f9a9255f9d120d3b53e87032baeaf7802db8abd5a24de9def0a1a2b3934737da5e48c1236bd75ff1811aa63e66a5c16b4c272f480c7c260c36d184c615d67a5 CT = 39444056B95687CF222EFC56C4FEBD99D0EF6EF718376889840DCB35721B04960FEF47473B538C512D3CFB2E78A378CAA7B20986ED4F0D13670282DD64110E06C71ECE1B05E0D0CDFA0389EEDC1454F8D14430CB3C3339C754FDB36B8EBE611D12A6117751FD2A834444B0B0ED1AD8464C328424958BF8B75A2AB8E7D537E40ABB33FC775F4BEE8EA92C8439698C99105D7B520D6398684C1DB9B0421A89AB514C75914B5D8C3C511E0B55BBA6F2B5E27C64D8C2E2AFA5A12B66DF5946BAEBD28804 -[mceliece6960119pc] +[6960119pc] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 35D4BE047205AFF8339FCF19935D5F3F3C09BAFC6E418448214D5F159915DED7 PK = 52244c54404fa392d586faec5a55ebe48c78386a3efce108684b89cc9b9c173a57ccfd6748712fcb6226f7a2add4506e1483107b88172e88589dfdaecd3a0948 SK = 53ca3551c31cd51be0074fc928264765de6bdef00810fc6bdb63ccd69d9e15b168c45a9dfce7bb48dbb131bbe772371b100285d2b282bad4f50b328b81e84826 CT = 63C39D29314866A0FE528B3D5DE37D5C6F72279EE711036198B0C2CA1F293D3541E0D1467D63D2E5C92B8060001CF002017F60B954C5DC457BA63C59BBE330BB66BC8726E605ACD0E90CD7167376F68CC071D4F931349564EF28D7EAB3D1FF61563EE1DEFD95A548004979736AB1B39BE08D57A49F39988F23574A5A06FC4C317F08C1B842EF844773BE74701E57EC91107DE40C6EEB222630621A6FBF2A4CB8CCB9C395ABD85FDC03C0FBE0E56EC9F7052B90608E21653FA2DE1AD62C68C2656C068CC5C37FC0AFD9B145CB3C4E7C30EF4D4C9F404E6FFFFB179AED0CF18B3BDA14 -[mceliece6960119pcf] +[6960119pcf] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 7ADF6895DBBC6AC1621374116E0D9EA53184601EDF88B53E55BEC013103F9269 PK = da30411922f1c72600f5e5846f6d0815f41fee4aed87226e61a6d8c28045fe332859f24e9245f095f253ae30ac70b220436ee21d14f58859aa5da5c0fa61b8be SK = 0f9a9255f9d120d3b53e87032baeaf7802db8abd5a24de9def0a1a2b3934737da5e48c1236bd75ff1811aa63e66a5c16b4c272f480c7c260c36d184c615d67a5 CT = 39444056B95687CF222EFC56C4FEBD99D0EF6EF718376889840DCB35721B04960FEF47473B538C512D3CFB2E78A378CAA7B20986ED4F0D13670282DD64110E06C71ECE1B05E0D0CDFA0389EEDC1454F8D14430CB3C3339C754FDB36B8EBE611D12A6117751FD2A834444B0B0ED1AD8464C328424958BF8B75A2AB8E7D537E40ABB33FC775F4BEE8EA92C8439698C99105D7B520D6398684C1DB9B0421A89AB514C75914B5D8C3C511E0B55BBA6F2B5E27C64D8C2E2AFA5A12B66DF5946BAEBD288048CC5C37FC0AFD9B145CB3C4E7C30EF4D4C9F404E6FFFFB179AED0CF18B3BDA14 -[mceliece8192128] +[8192128] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 82351702A2C3973644CB735FC9B6CEA8FE526D7D729EE134FC12C0201690E854 PK = d9c71f2e10a72ff75517b6b209e2826e53ab8d1f4c16985ae039413a1b117713c668dd8c24ca53d0b0089664a419eeadc7778ad13ccc27ea9dc6b25b1ce290fb SK = 705a3860712eadd0fbd892b10e46e82d32e678080165a4ec6b5b22ffc878e62d157b18ca7513dbafca4b7abb5f2f34992cb003d9617230f0d7de62ea7b63e806 CT = AD9728E7519C5F851FDA1148CF652893C8884288930995416F95798C4F2E0151FF617828CBCBC74BA3870D04E41FB875BE651A8070E23B89D47362833D899ABB57D25886FD9B71C2027C3F32FB5D699922053BA4E7297E9EE87838DBC06677E0B4EB4D9EDEA0945A6D0A01020BB30C33CF0498373B9AF3517DD20331FFB1F8177946251EFA80BE477E96D8ACAF5F2AB93DE67868DE506B44E0A1FA058176450A380901A5AA0E033642A7ECCD50C77916268AD225AFB3B7A1560FAF4CF476ACFFBBFA30D1EFF17FBD73B109CF9FF2ECC0 -[mceliece8192128f] +[8192128f] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = BC1E92FBD34B7907C0FA2568C5E5FA936AF7A6F0C2EE642BDFC760D894683F92 PK = 490df50a0c816ea209ef617e9eebe374cbac7fc8c26b4be415f499630fda470db300fade9d7a07da1f6f6548c6e6db779ca6300a9ba07981bf4dbe7b2f393f05 SK = 1b15567eacdd9608decd182a295d8753c048a898df84d1d6b731e4012c1dd64396801c2d423e2baf10f5b37372dcb214ee4b9b23e4167a8535fde363d30a7b8f CT = F220F073D58E77C3AF5C366C94CEDFF259E4144C8FBA8ECBF833582C2922429431D7BCCA15D587405CF646411CE113950DE7B15E92ACFF8BDB99385BE1917F7EE68CBA58C32505282C568D67EE29C84B07988C9D4D02CD5A21544A3050D24B7001B3232FBC534F2033AB7A10AB4E5C816A0CE7B1FBDB46D2DBB5FAC934BCFA57C675265564AF3400EA4DCED7E68BEDB0AF4C52A25BFBA6BE2162AA7ADB8EF685EFBC119407A6938AF904630B7E755A9D2F7496F06129EE7538D09144107BD51BC725D6D5A73F419D8277BBC195FF4C7F -[mceliece8192128pc] +[8192128pc] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = 870B2D45FA3CCEA8186F3929DE0B68798F65A34D01353B2EBFD6B1FBC2707897 PK = d9c71f2e10a72ff75517b6b209e2826e53ab8d1f4c16985ae039413a1b117713c668dd8c24ca53d0b0089664a419eeadc7778ad13ccc27ea9dc6b25b1ce290fb SK = 705a3860712eadd0fbd892b10e46e82d32e678080165a4ec6b5b22ffc878e62d157b18ca7513dbafca4b7abb5f2f34992cb003d9617230f0d7de62ea7b63e806 CT = AD9728E7519C5F851FDA1148CF652893C8884288930995416F95798C4F2E0151FF617828CBCBC74BA3870D04E41FB875BE651A8070E23B89D47362833D899ABB57D25886FD9B71C2027C3F32FB5D699922053BA4E7297E9EE87838DBC06677E0B4EB4D9EDEA0945A6D0A01020BB30C33CF0498373B9AF3517DD20331FFB1F8177946251EFA80BE477E96D8ACAF5F2AB93DE67868DE506B44E0A1FA058176450A380901A5AA0E033642A7ECCD50C77916268AD225AFB3B7A1560FAF4CF476ACFFBBFA30D1EFF17FBD73B109CF9FF2ECC03EDD086216C90F28C78E03C496B56E6659DC95C5F7C51A371D36BAD9BC1757C2 -[mceliece8192128pcf] +[8192128pcf] Seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 SS = EC35D8E55EB7ACE9866694FC0915402EA0720A85C5A3DB8A93D627F0432A452E PK = 490df50a0c816ea209ef617e9eebe374cbac7fc8c26b4be415f499630fda470db300fade9d7a07da1f6f6548c6e6db779ca6300a9ba07981bf4dbe7b2f393f05 diff --git a/src/tests/data/pubkey/cmce_negative.vec b/src/tests/data/pubkey/cmce_negative.vec index 3763b2c6860..db24656899b 100644 --- a/src/tests/data/pubkey/cmce_negative.vec +++ b/src/tests/data/pubkey/cmce_negative.vec @@ -9,12 +9,12 @@ # output shared secret is given (ct_invalid_c1/ss_invalid_c1), where one bit of C_1 is flipped # (ciphertext = C_0 || C_1), which is handled by plaintext confirmation. -[mceliece348864f] +[348864f] seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 ct_invalid = E305BB2814DED1582864F2B1D2A26397411EE4E61F6998FF61CD55E4C4FB35AB99788D00F42D2D3B79B0820035749776CAA82730B1EBE2B81230424FCBCB8B5A804B0FA3025B108175456F80F4ABD1786C5DB02C6564333DE9FE67ED4A92D6FE ss_invalid = 9AADA66ACAA96C4BCD5059155B23BE5DF7BC22527FE19161AAF0BF712F4F07EE -[mceliece6688128pcf] +[6688128pcf] seed = 061550234D158C5EC95595FE04EF7A25767F2E24CC2BC479D09D86DC9ABCFDE7056A8C266F9EF97ED08541DBD2E1FFA1 ct_invalid_c1 = 640B4DA81C3198D4707E02CAD713E8EB6BE431076E3EE7D6AA5323A9C551FEFE8BDC978052A55244D9347C2DB4A5EF76C6FFF4EE3F3E973ACBD58C0E03665DAF1857B2987CF463994CC31E95645F81CF2E18F7D5EBBC1212689B6F8765692DDD0F7852FACED8471BDA55737ED4E3129ADE84E246C20D02780D590D47D6D90BB2A6FA7141B72290DB4EE1478E09B1B48B7D8CCE4F37E329A1ED8F9BBAC4DAC6040358CED8B4B96289AB5BE27A95FB35A0D603DCC7E94D8C9A9728A3896D1EE556F5E185DC542DA1CB07A7480D5618D647EA79099D6282BAD1AF5B0CA919D112A35B12FD483FA90F9FD8B72D15E668E443 ss_invalid_c1 = F9EC0EA86FDCCEBBD90EF0394054F4631E187119B6379B2E2BC46986DD6D280A diff --git a/src/tests/test_cmce.cpp b/src/tests/test_cmce.cpp index 7e8e02dd690..0a449645034 100644 --- a/src/tests/test_cmce.cpp +++ b/src/tests/test_cmce.cpp @@ -45,32 +45,32 @@ Botan::Classic_McEliece_Polynomial create_element_from_bytes(std::span get_test_instances_all() { return {// All instances - Botan::Classic_McEliece_Parameter_Set::mceliece348864, - Botan::Classic_McEliece_Parameter_Set::mceliece348864f, - - Botan::Classic_McEliece_Parameter_Set::mceliece460896, - Botan::Classic_McEliece_Parameter_Set::mceliece460896f, - - Botan::Classic_McEliece_Parameter_Set::mceliece6688128, - Botan::Classic_McEliece_Parameter_Set::mceliece6688128f, - Botan::Classic_McEliece_Parameter_Set::mceliece6688128pc, - Botan::Classic_McEliece_Parameter_Set::mceliece6688128pcf, - - Botan::Classic_McEliece_Parameter_Set::mceliece6960119, - Botan::Classic_McEliece_Parameter_Set::mceliece6960119f, - Botan::Classic_McEliece_Parameter_Set::mceliece6960119pc, - Botan::Classic_McEliece_Parameter_Set::mceliece6960119pcf, - - Botan::Classic_McEliece_Parameter_Set::mceliece8192128, - Botan::Classic_McEliece_Parameter_Set::mceliece8192128f, - Botan::Classic_McEliece_Parameter_Set::mceliece8192128pc, - Botan::Classic_McEliece_Parameter_Set::mceliece8192128pcf}; + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f, + + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f, + + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf, + + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf, + + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf}; } std::vector get_test_instances_min() { return {// Testing with and without pc and f. Also testing 6960119 with m*t mod 8 != 0. - Botan::Classic_McEliece_Parameter_Set::mceliece348864, - Botan::Classic_McEliece_Parameter_Set::mceliece6960119pcf}; + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864, + Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf}; } std::vector instances_to_test() { @@ -94,7 +94,7 @@ class CMCE_Utility_Tests final : public Test { Test::Result result("Seed expansion"); auto params = - Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::mceliece348864); + Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864); // Created using the reference implementation auto seed = Botan::hex_decode_locked("0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"); @@ -118,7 +118,7 @@ class CMCE_Utility_Tests final : public Test { Test::Result result("Irreducible Polynomial Generation"); auto params = - Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::mceliece348864); + Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864); // Created using the reference implementation auto random_bits = Botan::CmceIrreducibleBits(Botan::hex_decode( @@ -142,7 +142,7 @@ class CMCE_Utility_Tests final : public Test { Test::Result result("GF inv test"); auto params = - Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::mceliece348864); + Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864); auto v = params.gf(Botan::CmceGfElem(42)); auto v_inv = v.inv(); @@ -155,7 +155,7 @@ class CMCE_Utility_Tests final : public Test { Test::Result result("GF Poly Mul"); auto params = - Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::mceliece348864); + Botan::Classic_McEliece_Parameters::create(Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864); const auto& field = params.poly_ring(); @@ -202,7 +202,7 @@ class CMCE_Utility_Tests final : public Test { Test::Result result("No endless loop with rigged RNG"); // Key creation should work even with a rigged RNG (PRNG is not used for key creation) - auto private_key = Botan::create_private_key("ClassicMcEliece", rigged_rng, "mceliece348864f"); + auto private_key = Botan::create_private_key("ClassicMcEliece", rigged_rng, "348864f"); if(!private_key) { result.test_failure("Key generation failed"); return result; diff --git a/src/tests/test_ffi.cpp b/src/tests/test_ffi.cpp index be77b388ff8..e650a592cf6 100644 --- a/src/tests/test_ffi.cpp +++ b/src/tests/test_ffi.cpp @@ -3874,26 +3874,26 @@ class FFI_Classic_McEliece_Test final : public FFI_KEM_Roundtrip_Test { std::vector modes() const override { auto modes = std::vector{ - "mceliece348864f", - "mceliece460896f", + "348864f", + "460896f", }; if(Test::run_long_tests()) { modes = Botan::concat(modes, std::vector{ - "mceliece348864", - "mceliece460896", - "mceliece6688128", - "mceliece6688128f", - "mceliece6688128pc", - "mceliece6688128pcf", - "mceliece6960119", - "mceliece6960119f", - "mceliece6960119pc", - "mceliece6960119pcf", - "mceliece8192128", - "mceliece8192128f", - "mceliece8192128pc", - "mceliece8192128pcf", + "348864", + "460896", + "6688128", + "6688128f", + "6688128pc", + "6688128pcf", + "6960119", + "6960119f", + "6960119pc", + "6960119pcf", + "8192128", + "8192128f", + "8192128pc", + "8192128pcf", }); } return modes;