Botan 3.7.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 Classic McEliece ISO Draft.
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 Draft.
24 * Instance with 'f' use matrix reduction with the semi-systematic form.
25 */
27 public:
28 enum class Code {
29 ClassicMcEliece_348864, // NIST
30 ClassicMcEliece_348864f, // NIST
31
32 ClassicMcEliece_460896, // NIST
33 ClassicMcEliece_460896f, // NIST
34
35 ClassicMcEliece_6688128, // ISO + NIST
36 ClassicMcEliece_6688128f, // ISO + NIST
37 ClassicMcEliece_6688128pc, // ISO
38 ClassicMcEliece_6688128pcf, // ISO
39
40 ClassicMcEliece_6960119, // ISO + NIST
41 ClassicMcEliece_6960119f, // ISO + NIST
42 ClassicMcEliece_6960119pc, // ISO
43 ClassicMcEliece_6960119pcf, // ISO
44
45 ClassicMcEliece_8192128, // ISO + NIST
46 ClassicMcEliece_8192128f, // ISO + NIST
47 ClassicMcEliece_8192128pc, // ISO
48 ClassicMcEliece_8192128pcf, // ISO
49 };
50
51 using enum Code;
52
53 Classic_McEliece_Parameter_Set(Code code) : m_code(code) {}
54
55 /**
56 * @brief Get the parameter set for a given parameter set name.
57 */
58 static Classic_McEliece_Parameter_Set from_string(std::string_view param_name);
59
60 /**
61 * @brief Get the parameter set name for a given parameter set.
62 */
63 std::string to_string() const;
64
65 /**
66 * @brief Get the parameter set for a given OID.
67 */
68 static Classic_McEliece_Parameter_Set from_oid(const OID& oid);
69
70 /**
71 * @brief Get the code for a given parameter set.
72 */
73 Code code() const { return m_code; }
74
75 bool operator==(const Classic_McEliece_Parameter_Set& other) const { return m_code == other.m_code; }
76
77 private:
78 const Code m_code;
79};
80
81} // namespace Botan
82
83#endif // BOTAN_CMCE_PARAMETER_SET_H_
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:19
Code code() const
Get the code for a given parameter set.
bool operator==(const Classic_McEliece_Parameter_Set &other) const