18 #ifndef XMSS_STRUCTURES_H_INCLUDED
20 #define XMSS_STRUCTURES_H_INCLUDED
50 #define XMSS_PRIVATE_KEY_STATELESS_BLOB_SIZE \
51 (sizeof(XmssPrivateKeyStatelessBlob) + sizeof(XmssValue256) + 4 + 4 + 4 + 4 + XMSS_PRIVATE_KEY_STATELESS_PART_SIZE)
77 #define XMSS_PRIVATE_KEY_STATEFUL_BLOB_SIZE \
78 (sizeof(XmssPrivateKeyStatefulBlob) + sizeof(XmssValue256) + 4 + 4 + 4 + 4 + sizeof(XmssValue256) + \
79 2 * XMSS_PRIVATE_KEY_STATEFUL_PART_SIZE)
112 #define XMSS_PUBLIC_KEY_INTERNAL_BLOB_SIZE(cache_type, cache_level, param_set) \
113 (sizeof(XmssPublicKeyInternalBlob) + sizeof(XmssValue256) + 4u + 4u + sizeof(XmssValue256) + sizeof(XmssValue256) + \
114 4u + 4u + 4u + 4u + sizeof(XmssValue256) * XMSS_CACHE_ENTRY_COUNT(cache_type, cache_level, param_set))
148 #define XMSS_PUBLIC_KEY_SIZE \
149 (sizeof(XmssPublicKey))
223 if (signature == NULL) {
239 #define XMSS_SIGNATURE_SIZE(param_set) \
240 (sizeof(XmssSignature) + sizeof(XmssValue256) * XMSS_TREE_DEPTH(param_set))
250 #define XMSS_SIGNATURE_BLOB_SIZE(param_set) \
251 (sizeof(XmssSignatureBlob) + XMSS_SIGNATURE_SIZE(param_set))
261 #define XMSS_VERIFICATION_CONTEXT_SIZE (4 + 4 + 8 + 8 + 200 + 8 + 32)
#define XMSS_STATIC_ASSERT(cond, msg)
Syntactical equivalent of _Static_assert(), which is C11.
Definition: compat.h:40
Public definitions of opaque structures and memory management calls for those.
A stored stateful private key part.
Definition: structures.h:66
uint8_t data[]
The data to be stored.
Definition: structures.h:70
size_t data_size
The size in bytes of the data array.
Definition: structures.h:68
A stored stateless private key part.
Definition: structures.h:39
size_t data_size
The size in bytes of the data array.
Definition: structures.h:41
uint8_t data[]
The data to be stored.
Definition: structures.h:43
A stored public key for the signing library.
Definition: structures.h:94
size_t data_size
The size in bytes of the data array.
Definition: structures.h:96
uint8_t data[]
The data to be stored.
Definition: structures.h:98
Exportable format for a public key.
Definition: structures.h:126
uint32_t scheme_identifier
The XmssParameterSetOID with which this public key was generated.
Definition: structures.h:134
XmssValue256 root
The public key root.
Definition: structures.h:136
XmssValue256 seed
The public SEED.
Definition: structures.h:138
Structure that embeds the exportable format for a signature, along with the signature's data size.
Definition: structures.h:194
size_t data_size
The size in bytes of the exported signature.
Definition: structures.h:205
uint8_t data[]
The signature data in the format described by RFC 8391, Section 4.1.8. This will always contain one s...
Definition: structures.h:211
Exportable format for a signature.
Definition: structures.h:160
XmssValue256 authentication_path[]
The authentication path.
Definition: structures.h:181
XmssValue256 wots_signature[67]
The WOTS+ signature.
Definition: structures.h:173
XmssValue256 random_bytes
The randomized hashing string $r$.
Definition: structures.h:171
uint32_t leaf_index
The leaf index of the key that was used for generating the signature. If index obfuscation is used,...
Definition: structures.h:169
A generic 256-bit value, represented as a byte stream.
Definition: types.h:279
#define XMSS_SIGNATURE_BLOB_SIZE(param_set)
The size in bytes of an XmssSignatureBlob.
Definition: structures.h:250
static XmssSignature * xmss_get_signature_struct(const XmssSignatureBlob *const signature)
Provide access to an XmssSignatureBlob's data as a structured type.
Definition: structures.h:221
#define XMSS_VERIFICATION_CONTEXT_SIZE
Size of an XmssVerificationContext.
Definition: structures.h:261
Enumerations, basic types and callback function specifications.
@ XMSS_PARAM_SHA2_16_256
SHA-256, tree height 16.
Definition: types.h:191
@ XMSS_PARAM_SHA2_10_256
SHA-256, tree height 10.
Definition: types.h:188
The context for signature verification.
Definition: structures.h:267
uint8_t data[XMSS_VERIFICATION_CONTEXT_SIZE]
Content of the XmssVerificationContext, opaque to the library user.
Definition: structures.h:269
uint64_t alignment
Enforces alignment of data.
Definition: structures.h:271