XMSS Library
structures.h File Reference

XMSS library specific structured types. More...

#include "compat.h"
#include "opaque_structures.h"
#include "types.h"
Include dependency graph for structures.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  XmssPrivateKeyStatelessBlob
 A stored stateless private key part. More...
 
struct  XmssPrivateKeyStatefulBlob
 A stored stateful private key part. More...
 
struct  XmssPublicKeyInternalBlob
 A stored public key for the signing library. More...
 
struct  XmssPublicKey
 Exportable format for a public key. More...
 
struct  XmssSignature
 Exportable format for a signature. More...
 
struct  XmssSignatureBlob
 Structure that embeds the exportable format for a signature, along with the signature's data size. More...
 
union  XmssVerificationContext
 The context for signature verification. More...
 

Macros

#define XMSS_STRUCTURES_H_INCLUDED
 Include guard.
 
#define XMSS_PRIVATE_KEY_STATELESS_BLOB_SIZE    (sizeof(XmssPrivateKeyStatelessBlob) + sizeof(XmssValue256) + 4 + 4 + 4 + 4 + XMSS_PRIVATE_KEY_STATELESS_PART_SIZE)
 The size in bytes of an XmssPrivateKeyStatelessBlob.
 
#define XMSS_PRIVATE_KEY_STATEFUL_BLOB_SIZE
 The size in bytes of an XmssPrivateKeyStatefulBlob. More...
 
#define XMSS_PUBLIC_KEY_INTERNAL_BLOB_SIZE(cache_type, cache_level, param_set)
 The size in bytes of an XmssPublicKeyInternalBlob. More...
 
#define XMSS_PUBLIC_KEY_SIZE    (sizeof(XmssPublicKey))
 The size of the XmssPublicKey. More...
 
#define XMSS_SIGNATURE_SIZE(param_set)    (sizeof(XmssSignature) + sizeof(XmssValue256) * XMSS_TREE_DEPTH(param_set))
 The size in bytes of an XmssSignature. More...
 
#define XMSS_SIGNATURE_BLOB_SIZE(param_set)    (sizeof(XmssSignatureBlob) + XMSS_SIGNATURE_SIZE(param_set))
 The size in bytes of an XmssSignatureBlob. More...
 
#define XMSS_VERIFICATION_CONTEXT_SIZE   (4 + 4 + 8 + 8 + 200 + 8 + 32)
 Size of an XmssVerificationContext.
 

Functions

static XmssSignaturexmss_get_signature_struct (const XmssSignatureBlob *const signature)
 Provide access to an XmssSignatureBlob's data as a structured type. More...
 

Detailed Description

XMSS library specific structured types.

There is no need to include this header explicitly. Instead, include either verification.h or signing.h.

Macro Definition Documentation

◆ XMSS_PRIVATE_KEY_STATEFUL_BLOB_SIZE

#define XMSS_PRIVATE_KEY_STATEFUL_BLOB_SIZE
Value:
(sizeof(XmssPrivateKeyStatefulBlob) + sizeof(XmssValue256) + 4 + 4 + 4 + 4 + sizeof(XmssValue256) + \
#define XMSS_PRIVATE_KEY_STATEFUL_PART_SIZE
The size in bytes of the stateful part of a private key.
Definition: opaque_structures.h:132
A stored stateful private key part.
Definition: structures.h:66
A generic 256-bit value, represented as a byte stream.
Definition: types.h:279

The size in bytes of an XmssPrivateKeyStatefulBlob.

◆ XMSS_PUBLIC_KEY_INTERNAL_BLOB_SIZE

#define XMSS_PUBLIC_KEY_INTERNAL_BLOB_SIZE (   cache_type,
  cache_level,
  param_set 
)
Value:
(sizeof(XmssPublicKeyInternalBlob) + sizeof(XmssValue256) + 4u + 4u + sizeof(XmssValue256) + sizeof(XmssValue256) + \
4u + 4u + 4u + 4u + sizeof(XmssValue256) * XMSS_CACHE_ENTRY_COUNT(cache_type, cache_level, param_set))
#define XMSS_CACHE_ENTRY_COUNT(cache_type, cache_level, param_set)
The number of cached entries for a specific cache configuration.
Definition: opaque_structures.h:80
A stored public key for the signing library.
Definition: structures.h:94

The size in bytes of an XmssPublicKeyInternalBlob.

Note
The arguments to XMSS_PUBLIC_KEY_INTERNAL_BLOB_SIZE() will be evaluated multiple times.
Parameters
[in]cache_typeThe cache type that is used.
[in]cache_levelThe cache level that is to be held.
[in]param_setThe parameter set for the public key.
See also
xmss_generate_public_key() for more information about the cache type and level.

◆ XMSS_PUBLIC_KEY_SIZE

#define XMSS_PUBLIC_KEY_SIZE    (sizeof(XmssPublicKey))

The size of the XmssPublicKey.

Included for API consistency.

◆ XMSS_SIGNATURE_BLOB_SIZE

#define XMSS_SIGNATURE_BLOB_SIZE (   param_set)     (sizeof(XmssSignatureBlob) + XMSS_SIGNATURE_SIZE(param_set))

The size in bytes of an XmssSignatureBlob.

Note
The argument to XMSS_SIGNATURE_BLOB_SIZE() will be evaluated multiple times.
Parameters
[in]param_setThe XmssParameterSetOID that was used for the signature.

◆ XMSS_SIGNATURE_SIZE

#define XMSS_SIGNATURE_SIZE (   param_set)     (sizeof(XmssSignature) + sizeof(XmssValue256) * XMSS_TREE_DEPTH(param_set))

The size in bytes of an XmssSignature.

Note that when using the XMSS API, XmssSignatureBlob and XMSS_SIGNATURE_BLOB_SIZE() should be used.

Note
The argument to XMSS_SIGNATURE_SIZE() will be evaluated multiple times.
Parameters
[in]param_setThe XmssParameterSetOID that was used for the signature.

Function Documentation

◆ xmss_get_signature_struct()

static XmssSignature* xmss_get_signature_struct ( const XmssSignatureBlob *const  signature)
inlinestatic

Provide access to an XmssSignatureBlob's data as a structured type.

Parameters
[in]signatureThe signature to access as a struct.
Returns
A pointer to the signature struct. NULL if signature is NULL.