Skip to content

Commit

Permalink
add xmss build artifact needed for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
peterohanley committed Feb 12, 2025
1 parent 53cb312 commit b7158cc
Showing 1 changed file with 154 additions and 0 deletions.
154 changes: 154 additions & 0 deletions components/platform_crypto/shave_trusted_boot/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/*
* SPDX-FileCopyrightText: 2023 Fox Crypto B.V.
* SPDX-License-Identifier: MIT
*
* SPDX-FileContributor: Frans van Dorsselaer
*/

/**
* @file
* @brief
* The configurable CMake options that affect the internal parts of the library.
*
* @details
* For convenience, this header includes xmss_config.h (the public part of the configurable options) even though
* this header itself does not use it. Internal sources can simply include this file and get all options at once.
*/

#pragma once

#ifndef XMSS_CONFIG_H
/** @private @brief Include guard. */
#define XMSS_CONFIG_H

#include "xmss_config.h"

/**
* @brief
* Indicates whether SHA-256 support is enabled.
*
* @details
* By default, SHA-256 is enabled. This macro is defined with the value 0 if you compile the library with
* ```
* cmake -DXMSS_SHA256=Disabled
* ```
*/
#define XMSS_ENABLE_SHA256 1

/**
* @brief
* Indicates whether the SHA-256 default implementation is enabled.
*
* @details
* This macro is defined with the value 0 if you compile the library with
* ```
* cmake -DXMSS_SHA256={Disabled | OverrideInternal | OverrideGeneric}
* ```
*/
#define XMSS_ENABLE_SHA256_DEFAULT 1

/**
* @brief
* Indicates whether SHA-256 uses the generic interface.
*
* @details
* By default, SHA-256 uses the internal interface.
* This macro is defined with the value 1 if you compile the library with
* ```
* cmake -DXMSS_SHA256=OverrideGeneric
* ```
*/
#define XMSS_ENABLE_SHA256_GENERIC 0

/**
* @brief
* Indicates whether SHAKE256/256 support is enabled.
*
* @details
* By default, SHAKE256/256 is enabled. This macro is defined with the value 0 if you compile the library with
* ```
* cmake -DXMSS_SHAKE256_256=Disabled
* ```
*/
#define XMSS_ENABLE_SHAKE256_256 1

/**
* @brief
* Indicates whether the SHAKE256/256 default implementation is enabled.
*
* @details
* This macro is defined with the value 0 if you compile the library with
* ```
* cmake -DXMSS_SHAKE256_256={Disabled | OverrideInternal | OverrideGeneric}
* ```
*/
#define XMSS_ENABLE_SHAKE256_256_DEFAULT 1

/**
* @brief
* Indicates whether SHAKE256/256 uses the generic interface.
*
* @details
* By default, SHAKE256/256 uses the internal interface.
* This macro is defined with the value 1 if you compile the library with
* ```
* cmake -DXMSS_SHAKE256_256=OverrideGeneric
* ```
*/
#define XMSS_ENABLE_SHAKE256_256_GENERIC 0

/**
* @brief
* Indicates whether the compiler supports `#pragma optimize`.
*
* @details
* This option is automatically detected by CMake.
*/
#define XMSS_CAN_USE_PRAGMA_OPTIMIZE 0

/**
* @brief
* Indicates whether the compiler supports `#pragma GCC optimize`.
*
* @details
* This option is automatically detected by CMake.
*/
#define XMSS_CAN_USE_PRAGMA_GCC_OPTIMIZE 0

/**
* @brief
* Indicates whether the compiler supports `#pragma clang optimize`.
*
* @details
* This option is automatically detected by CMake.
*/
#define XMSS_CAN_USE_PRAGMA_CLANG_OPTIMIZE 1

/**
* @brief
* Indicates whether both SHA-256 and SHAKE256/256 are enabled.
*
* @details
* By default, both hash algorithms are enabled.
* This macro is defined with the value 0 if either one of the hash algorithms is disabled.
* @see XMSS_ENABLE_SHA256
* @see XMSS_ENABLE_SHAKE256_256
*/
#if XMSS_ENABLE_SHA256 && XMSS_ENABLE_SHAKE256_256
# define XMSS_ENABLE_HASH_ABSTRACTION 1
#else
# define XMSS_ENABLE_HASH_ABSTRACTION 0
#endif

/**
* @brief
* Allows compilation of otherwise empty translation units.
*
* @details
* Some source files include this file and, as a result of `#if`s based on configuration options defined here, end up
* empty. C99 does not allow empty translation units. This typedef makes such source files officially non-empty
* (even though it does not generate anything) and allows them to compile correctly.
*/
typedef int xmss_prevent_empty_translation_unit;

#endif /* !XMSS_CONFIG_H */

0 comments on commit b7158cc

Please sign in to comment.