Botan 3.14.1
Crypto and TLS for C&
cmce_parameter_set.h
Go to the documentation of this file.
1/*
2 * Classic McEliece Parameters
3 * (C) 2024 Jack Lloyd
4 * 2024 Fabian Albert, Amos Treiber - Rohde & Schwarz Cybersecurity
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 **/
8
9#ifndef BOTAN_CMCE_PARAMETER_SET_H_
10#define BOTAN_CMCE_PARAMETER_SET_H_
11
12#include <botan/asn1_obj.h>
13
14namespace Botan {
15
16/**
17 * All Classic McEliece parameter sets defined in the NIST Round 4
18 * submission and the ISO standard (ISO/IEC 18033-2:2006/Amd 2).
19 *
20 * Instances are defined in the following format:
21 * mceliece{n}{t}{[pc]}{[f]}
22 *
23 * Instance with 'pc' use plaintext confirmation as defined in the ISO standard.
24 * Instance with 'f' use matrix reduction with the semi-systematic form.
25 */
27 public:
28 enum class Code : uint8_t {
29 ClassicMcEliece_348864, // NIST
30 ClassicMcEliece_348864f, // NIST
31
32 ClassicMcEliece_460896, // ISO + NIST
33 ClassicMcEliece_460896f, // ISO + NIST
34 // Note: mceliece460896pc(f) are defined in the ISO standard but not implemented here
35
36 ClassicMcEliece_6688128, // ISO + NIST
37 ClassicMcEliece_6688128f, // ISO + NIST
38 ClassicMcEliece_6688128pc, // ISO
39 ClassicMcEliece_6688128pcf, // ISO
40
41 ClassicMcEliece_6960119, // ISO + NIST
42 ClassicMcEliece_6960119f, // ISO + NIST
43 ClassicMcEliece_6960119pc, // ISO
44 ClassicMcEliece_6960119pcf, // ISO
45
46 ClassicMcEliece_8192128, // ISO + NIST
47 ClassicMcEliece_8192128f, // ISO + NIST
48 ClassicMcEliece_8192128pc, // ISO
49 ClassicMcEliece_8192128pcf, // ISO
50 };
51
52 using enum Code;
53
54 // NOLINTNEXTLINE(*-explicit-conversions,*-explicit-constructor)
56
57 /**
58 * @brief Get the parameter set for a given parameter set name.
59 */
60 static Classic_McEliece_Parameter_Set from_string(std::string_view param_name);
61
62 /**
63 * @brief Get the parameter set name for a given parameter set.
64 */
65 std::string to_string() const;
66
67 /**
68 * @brief Get the parameter set for a given OID.
69 */
70 static Classic_McEliece_Parameter_Set from_oid(const OID& oid);
71
72 /**
73 * @brief Get the code for a given parameter set.
74 */
75 Code code() const { return m_code; }
76
77 bool operator==(const Classic_McEliece_Parameter_Set& other) const { return m_code == other.m_code; }
78
79 private:
80 const Code m_code;
81};
82
83} // namespace Botan
84
85#endif // BOTAN_CMCE_PARAMETER_SET_H_
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:21
Code code() const
Get the code for a given parameter set.
bool operator==(const Classic_McEliece_Parameter_Set &other) const
std::string to_string(ErrorType type)
Convert an ErrorType to string.
Definition exceptn.cpp:13