Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | List of all members
Botan::XMSS_Parameters Class Reference

`#include <xmss_parameters.h>`

## Public Types
enum | xmss_algorithm_t { XMSS_SHA2_256_W16_H10 = 0x01000001, XMSS_SHA2_256_W16_H16 = 0x02000002, XMSS_SHA2_256_W16_H20 = 0x03000003, XMSS_SHA2_512_W16_H10 = 0x04000004, XMSS_SHA2_512_W16_H16 = 0x05000005, XMSS_SHA2_512_W16_H20 = 0x06000006, XMSS_SHAKE128_W16_H10 = 0x07000007, XMSS_SHAKE128_W16_H16 = 0x08000008, XMSS_SHAKE128_W16_H20 = 0x09000009, XMSS_SHAKE256_W16_H10 = 0x0a00000a, XMSS_SHAKE256_W16_H16 = 0x0b00000b, XMSS_SHAKE256_W16_H20 = 0x0c00000c }

## Public Member Functions
size_t | element_size () const
size_t | estimated_strength () const
const std::string & | hash_function_name () const
size_t | len () const
const std::string & | name () const
xmss_algorithm_t | oid () const
bool | operator== (const XMSS_Parameters &p) const
XMSS_WOTS_Parameters::ots_algorithm_t | ots_oid () const
size_t | tree_height () const
size_t | wots_parameter () const
| XMSS_Parameters (const std::string &algo_name)
| XMSS_Parameters (xmss_algorithm_t oid)

## Static Public Member Functions
static xmss_algorithm_t | xmss_id_from_string (const std::string &algo_name)

## Detailed Description

Descibes a signature method for XMSS, as defined in: [1] XMSS: Extended Hash-Based Signatures, draft-itrf-cfrg-xmss-hash-based-signatures-06 Release: July 2016. https://datatracker.ietf.org/doc/ draft-irtf-cfrg-xmss-hash-based-signatures/?include_text=1

Definition at line 28 of file xmss_parameters.h.

## Member Enumeration Documentation

enum Botan::XMSS_Parameters::xmss_algorithm_t

Enumerator
XMSS_SHA2_256_W16_H10 |
XMSS_SHA2_256_W16_H16 |
XMSS_SHA2_256_W16_H20 |
XMSS_SHA2_512_W16_H10 |
XMSS_SHA2_512_W16_H16 |
XMSS_SHA2_512_W16_H20 |
XMSS_SHAKE128_W16_H10 |
XMSS_SHAKE128_W16_H16 |
XMSS_SHAKE128_W16_H20 |
XMSS_SHAKE256_W16_H10 |
XMSS_SHAKE256_W16_H16 |
XMSS_SHAKE256_W16_H20 |

Definition at line 31 of file xmss_parameters.h.

32 {
33 XMSS_SHA2_256_W16_H10 = 0x01000001,
34 XMSS_SHA2_256_W16_H16 = 0x02000002,
35 XMSS_SHA2_256_W16_H20 = 0x03000003,
36 XMSS_SHA2_512_W16_H10 = 0x04000004,
37 XMSS_SHA2_512_W16_H16 = 0x05000005,
38 XMSS_SHA2_512_W16_H20 = 0x06000006,
39 XMSS_SHAKE128_W16_H10 = 0x07000007,
40 XMSS_SHAKE128_W16_H16 = 0x08000008,
41 XMSS_SHAKE128_W16_H20 = 0x09000009,
42 XMSS_SHAKE256_W16_H10 = 0x0a00000a,
43 XMSS_SHAKE256_W16_H16 = 0x0b00000b,
44 XMSS_SHAKE256_W16_H20 = 0x0c00000c
45 };
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H20
Definition: xmss_parameters.h:35
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H20
Definition: xmss_parameters.h:38
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H16
Definition: xmss_parameters.h:43
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H16
Definition: xmss_parameters.h:37
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H10
Definition: xmss_parameters.h:39
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H20
Definition: xmss_parameters.h:44
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H10
Definition: xmss_parameters.h:33
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H16
Definition: xmss_parameters.h:34
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H20
Definition: xmss_parameters.h:41
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H10
Definition: xmss_parameters.h:42
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H10
Definition: xmss_parameters.h:36
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H16
Definition: xmss_parameters.h:40

## Constructor & Destructor Documentation

Botan::XMSS_Parameters::XMSS_Parameters | ( | const std::string & | algo_name | ) |

Definition at line 49 of file xmss_parameters.cpp.

50 : XMSS_Parameters(XMSS_Parameters::xmss_id_from_string(param_set))
51 {
52 }
Botan::XMSS_Parameters::XMSS_Parameters
XMSS_Parameters(const std::string &algo_name)
Definition: xmss_parameters.cpp:49
Botan::XMSS_Parameters::xmss_id_from_string
static xmss_algorithm_t xmss_id_from_string(const std::string &algo_name)
Definition: xmss_parameters.cpp:20

Botan::XMSS_Parameters::XMSS_Parameters | ( | xmss_algorithm_t | oid | ) |

Definition at line 55 of file xmss_parameters.cpp.

References XMSS_SHA2_256_W16_H10, XMSS_SHA2_256_W16_H16, XMSS_SHA2_256_W16_H20, XMSS_SHA2_512_W16_H10, XMSS_SHA2_512_W16_H16, XMSS_SHA2_512_W16_H20, XMSS_SHAKE128_W16_H10, XMSS_SHAKE128_W16_H16, XMSS_SHAKE128_W16_H20, XMSS_SHAKE256_W16_H10, XMSS_SHAKE256_W16_H16, and XMSS_SHAKE256_W16_H20.

56 : m_oid(oid)
57 {
58 switch(oid)
59 {
60 case XMSS_SHA2_256_W16_H10:
61 m_element_size = 32;
62 m_w = 16;
63 m_len = 67;
64 m_tree_height = 10;
65 m_name = "XMSS_SHA2-256_W16_H10";
66 m_hash_name = "SHA-256";
67 m_strength = 256;
68 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256_W16;
69 break;
70 case XMSS_SHA2_256_W16_H16:
71 m_element_size = 32;
72 m_w = 16;
73 m_len = 67;
74 m_tree_height = 16;
75 m_name = "XMSS_SHA2-256_W16_H16";
76 m_hash_name = "SHA-256";
77 m_strength = 256;
78 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256_W16;
79 break;
80 case XMSS_SHA2_256_W16_H20:
81 m_element_size = 32;
82 m_w = 16;
83 m_len = 67;
84 m_tree_height = 20;
85 m_name = "XMSS_SHA2-256_W16_H20";
86 m_hash_name = "SHA-256";
87 m_strength = 256;
88 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_256_W16;
89 break;
90 case XMSS_SHA2_512_W16_H10:
91 m_element_size = 64;
92 m_w = 16;
93 m_len = 131;
94 m_tree_height = 10;
95 m_name = "XMSS_SHA2-512_W16_H10";
96 m_hash_name = "SHA-512";
97 m_strength = 512;
98 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512_W16;
99 break;
100 case XMSS_SHA2_512_W16_H16:
101 m_element_size = 64;
102 m_w = 16;
103 m_len = 131;
104 m_tree_height = 16;
105 m_name = "XMSS_SHA2-512_W16_H16";
106 m_hash_name = "SHA-512";
107 m_strength = 512;
108 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512_W16;
109 break;
110 case XMSS_SHA2_512_W16_H20:
111 m_element_size = 64;
112 m_w = 16;
113 m_len = 131;
114 m_tree_height = 20;
115 m_name = "XMSS_SHA2-512_W16_H20";
116 m_hash_name = "SHA-512";
117 m_strength = 512;
118 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHA2_512_W16;
119 break;
120 case XMSS_SHAKE128_W16_H10:
121 m_element_size = 32;
122 m_w = 16;
123 m_len = 67;
124 m_tree_height = 10;
125 m_name = "XMSS_SHAKE128_W16_H10";
126 m_hash_name = "SHAKE-128(256)";
127 m_strength = 256;
128 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE128_W16;
129 break;
130 case XMSS_SHAKE128_W16_H16:
131 m_element_size = 32;
132 m_w = 16;
133 m_len = 67;
134 m_tree_height = 16;
135 m_name = "XMSS_SHAKE128_W16_H16";
136 m_hash_name = "SHAKE-128(256)";
137 m_strength = 256;
138 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE128_W16;
139 break;
140 case XMSS_SHAKE128_W16_H20:
141 m_element_size = 32;
142 m_w = 16;
143 m_len = 67;
144 m_tree_height = 20;
145 m_name = "XMSS_SHAKE128_W16_H20";
146 m_hash_name = "SHAKE-128(256)";
147 m_strength = 256;
148 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE128_W16;
149 break;
150 case XMSS_SHAKE256_W16_H10:
151 m_element_size = 64;
152 m_w = 16;
153 m_len = 131;
154 m_tree_height = 10;
155 m_name = "XMSS_SHAKE256_W16_H10";
156 m_hash_name = "SHAKE-256(512)";
157 m_strength = 512;
158 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE256_W16;
159 break;
160 case XMSS_SHAKE256_W16_H16:
161 m_element_size = 64;
162 m_w = 16;
163 m_len = 131;
164 m_tree_height = 16;
165 m_name = "XMSS_SHAKE256_W16_H16";
166 m_hash_name = "SHAKE-256(512)";
167 m_strength = 512;
168 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE256_W16;
169 break;
170 case XMSS_SHAKE256_W16_H20:
171 m_element_size = 64;
172 m_w = 16;
173 m_len = 131;
174 m_tree_height = 20;
175 m_name = "XMSS_SHAKE256_W16_H20";
176 m_hash_name = "SHAKE-256(512)";
177 m_strength = 512;
178 m_wots_oid = XMSS_WOTS_Parameters::ots_algorithm_t::WOTSP_SHAKE256_W16;
179 break;
180 default:
181 throw Unsupported_Argument(
182 "Algorithm id does not match any XMSS algorithm id.");
183 break;
184 }
185 }
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H20
Definition: xmss_parameters.h:35
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H20
Definition: xmss_parameters.h:38
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H16
Definition: xmss_parameters.h:43
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H16
Definition: xmss_parameters.h:37
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H10
Definition: xmss_parameters.h:39
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H20
Definition: xmss_parameters.h:44
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H10
Definition: xmss_parameters.h:33
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H16
Definition: xmss_parameters.h:34
Botan::XMSS_Parameters::oid
xmss_algorithm_t oid() const
Definition: xmss_parameters.h:89
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H20
Definition: xmss_parameters.h:41
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H10
Definition: xmss_parameters.h:42
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H10
Definition: xmss_parameters.h:36
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H16
Definition: xmss_parameters.h:40

## Member Function Documentation

size_t Botan::XMSS_Parameters::element_size | ( |  | ) | const
| inline

Retrieves the uniform length of a message, and the size of each node. This correlates to XMSS parameter "n" defined in [1].

Returns
  element length in bytes.

Definition at line 72 of file xmss_parameters.h.

Referenced by Botan::XMSS_Common_Ops::randomize_tree_hash(), Botan::XMSS_PrivateKey::XMSS_PrivateKey(), Botan::XMSS_PublicKey::XMSS_PublicKey(), and Botan::XMSS_Signature::XMSS_Signature().

72 { return m_element_size; }

size_t Botan::XMSS_Parameters::estimated_strength | ( |  | ) | const
| inline

Returns the estimated pre-quantum security level of the chosen algorithm.

Definition at line 100 of file xmss_parameters.h.

101 {
102 return m_strength;
103 }

const std::string& Botan::XMSS_Parameters::hash_function_name | ( |  | ) | const
| inline

Definition at line 60 of file xmss_parameters.h.

61 {
62 return m_hash_name;
63 }

size_t Botan::XMSS_Parameters::len | ( |  | ) | const
| inline

Definition at line 87 of file xmss_parameters.h.

Referenced by Botan::XMSS_Common_Ops::create_l_tree(), and Botan::XMSS_Signature::XMSS_Signature().

87 { return m_len; }

const std::string& Botan::XMSS_Parameters::name | ( |  | ) | const
| inline

Returns
  XMSS registry name for the chosen parameter set.

Definition at line 55 of file xmss_parameters.h.

References m_name.

56 {
57 return m_name;
58 }

xmss_algorithm_t Botan::XMSS_Parameters::oid | ( |  | ) | const
| inline

Definition at line 89 of file xmss_parameters.h.

References m_oid.

Referenced by Botan::XMSS_Verification_Operation::is_valid_signature(), and Botan::XMSS_PublicKey::raw_public_key().

89 { return m_oid; }

bool Botan::XMSS_Parameters::operator== | ( | const XMSS_Parameters & | p | ) | const
| inline

Definition at line 105 of file xmss_parameters.h.

References m_oid.

106 {
107 return m_oid == p.m_oid;
108 }

XMSS_WOTS_Parameters::ots_algorithm_t Botan::XMSS_Parameters::ots_oid | ( |  | ) | const
| inline

Definition at line 91 of file xmss_parameters.h.

92 {
93 return m_wots_oid;
94 }

size_t Botan::XMSS_Parameters::tree_height | ( |  | ) | const
| inline

Returns
  The height (number of levels - 1) of the tree

Definition at line 77 of file xmss_parameters.h.

Referenced by Botan::XMSS_Signature::XMSS_Signature().

77 { return m_tree_height; }

size_t Botan::XMSS_Parameters::wots_parameter | ( |  | ) | const
| inline

The Winternitz parameter.

Returns
  numeric base used for internal representation of data.

Definition at line 85 of file xmss_parameters.h.

85 { return m_w; }

XMSS_Parameters::xmss_algorithm_t Botan::XMSS_Parameters::xmss_id_from_string | ( | const std::string & | algo_name | ) |
| static

Definition at line 20 of file xmss_parameters.cpp.

References XMSS_SHA2_256_W16_H10, XMSS_SHA2_256_W16_H16, XMSS_SHA2_256_W16_H20, XMSS_SHA2_512_W16_H10, XMSS_SHA2_512_W16_H16, XMSS_SHA2_512_W16_H20, XMSS_SHAKE128_W16_H10, XMSS_SHAKE128_W16_H16, XMSS_SHAKE128_W16_H20, XMSS_SHAKE256_W16_H10, XMSS_SHAKE256_W16_H16, and XMSS_SHAKE256_W16_H20.

21 {
22 if(param_set == "XMSS_SHA2-256_W16_H10")
23 return XMSS_SHA2_256_W16_H10;
24 if(param_set == "XMSS_SHA2-256_W16_H16")
25 return XMSS_SHA2_256_W16_H16;
26 if(param_set == "XMSS_SHA2-256_W16_H20")
27 return XMSS_SHA2_256_W16_H20;
28 if(param_set == "XMSS_SHA2-512_W16_H10")
29 return XMSS_SHA2_512_W16_H10;
30 if(param_set == "XMSS_SHA2-512_W16_H16")
31 return XMSS_SHA2_512_W16_H16;
32 if(param_set == "XMSS_SHA2-512_W16_H20")
33 return XMSS_SHA2_512_W16_H20;
34 if(param_set == "XMSS_SHAKE128_W16_H10")
35 return XMSS_SHAKE128_W16_H10;
36 if(param_set == "XMSS_SHAKE128_W16_H16")
37 return XMSS_SHAKE128_W16_H16;
38 if(param_set == "XMSS_SHAKE128_W16_H20")
39 return XMSS_SHAKE128_W16_H20;
40 if(param_set == "XMSS_SHAKE256_W16_H10")
41 return XMSS_SHAKE256_W16_H10;
42 if(param_set == "XMSS_SHAKE256_W16_H16")
43 return XMSS_SHAKE256_W16_H16;
44 if(param_set == "XMSS_SHAKE256_W16_H20")
45 return XMSS_SHAKE256_W16_H20;
46 throw Lookup_Error("Unknown XMSS algorithm param '" + param_set + "'");
47 }
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H20
Definition: xmss_parameters.h:35
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H20
Definition: xmss_parameters.h:38
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H16
Definition: xmss_parameters.h:43
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H16
Definition: xmss_parameters.h:37
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H10
Definition: xmss_parameters.h:39
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H20
Definition: xmss_parameters.h:44
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H10
Definition: xmss_parameters.h:33
Botan::XMSS_Parameters::XMSS_SHA2_256_W16_H16
Definition: xmss_parameters.h:34
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H20
Definition: xmss_parameters.h:41
Botan::XMSS_Parameters::XMSS_SHAKE256_W16_H10
Definition: xmss_parameters.h:42
Botan::XMSS_Parameters::XMSS_SHA2_512_W16_H10
Definition: xmss_parameters.h:36
Botan::XMSS_Parameters::XMSS_SHAKE128_W16_H16
Definition: xmss_parameters.h:40

The documentation for this class was generated from the following files:

- src/lib/pubkey/xmss/xmss_parameters.h
- src/lib/pubkey/xmss/xmss_parameters.cpp