XMSS Library
version.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2024 Fox Crypto B.V.
3  * SPDX-License-Identifier: MIT
4  *
5  * SPDX-FileContributor: Frans van Dorsselaer
6  */
7 
17 #pragma once
18 
19 #ifndef XMSS_VERSION_H_INCLUDED
21 #define XMSS_VERSION_H_INCLUDED
22 
23 #include "xmss_config.h"
24 
25 #include <stdint.h>
26 
27 #include "compat.h"
28 
31  "XMSS_LIBRARY_VERSION inconsistent");
34  "XMSS_LIBRARY_VERSION inconsistent");
37  "XMSS_LIBRARY_VERSION inconsistent");
38 
55 #define XMSS_LIBRARY_VERSION_CONSTRUCT(major, minor, patch) \
56  ((((uint32_t)(uint8_t)(major)) << 16) \
57  | (((uint32_t)(uint8_t)(minor)) << 8) \
58  | ((uint32_t)(uint8_t)(patch)))
59 
80 #define XMSS_LIBRARY_VERSION (XMSS_LIBRARY_VERSION_CONSTRUCT(XMSS_LIBRARY_VERSION_MAJOR, XMSS_LIBRARY_VERSION_MINOR, \
81  XMSS_LIBRARY_VERSION_PATCH))
82 
93 #define XMSS_LIBRARY_GET_VERSION_MAJOR(version) ((uint8_t)((((uint32_t)(version)) >> 16) & UINT8_MAX))
94 
105 #define XMSS_LIBRARY_GET_VERSION_MINOR(version) ((uint8_t)((((uint32_t)(version)) >> 8) & UINT8_MAX))
106 
117 #define XMSS_LIBRARY_GET_VERSION_PATCH(version) ((uint8_t)(((uint32_t)(version)) & UINT8_MAX))
118 
121  "XMSS_LIBRARY_VERSION inconsistent");
124  "XMSS_LIBRARY_VERSION inconsistent");
127  "XMSS_LIBRARY_VERSION inconsistent");
128 
157 
158 #endif /* !XMSS_VERSION_H_INCLUDED */
C99 compatibility layer.
#define XMSS_STATIC_ASSERT(cond, msg)
Syntactical equivalent of _Static_assert(), which is C11.
Definition: compat.h:40
#define XMSS_LIBRARY_VERSION
The amalgamated semantic version (SemVer 2.0) of the library headers.
Definition: version.h:80
#define XMSS_LIBRARY_GET_VERSION_MAJOR(version)
Retrieve the major version from an amalgamated semantic version.
Definition: version.h:93
uint32_t xmss_library_get_version(void)
Retrieve, at application runtime, the amalgamated semantic version (SemVer 2.0) of the library at bui...
#define XMSS_LIBRARY_GET_VERSION_MINOR(version)
Retrieve the minor version from an amalgamated semantic version.
Definition: version.h:105
#define XMSS_LIBRARY_GET_VERSION_PATCH(version)
Retrieve the patch version from an amalgamated semantic version.
Definition: version.h:117
The configurable CMake options that affect the public API.
#define XMSS_LIBRARY_VERSION_PATCH
The patch version of the library headers.
Definition: xmss_config.h:82
#define XMSS_LIBRARY_VERSION_MINOR
The minor version of the library headers.
Definition: xmss_config.h:73
#define XMSS_LIBRARY_VERSION_MAJOR
The major version of the library headers.
Definition: xmss_config.h:64