mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-22 04:53:50 +01:00
Currently PSA backends cannot use other backends because the necessary definitions are defined in a single big header file. This prevents us from creating a generic HMAC backend based on the available hash backends, as the hash context struct is not available when defining the HMAC context struct. Fix this by spliting the headers into separate files. This makes it possible us use the hash context definitions without pulling in the remaining context definitions. Signed-off-by: Armin Wolf <W_Armin@gmx.de>
51 lines
959 B
C
51 lines
959 B
C
/*
|
|
* Copyright (C) 2025 TU Dresden
|
|
* Copyright (C) 2021 HAW Hamburg
|
|
*
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
* directory for more details.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
/**
|
|
* @ingroup sys_psa_crypto
|
|
* @{
|
|
*
|
|
* @file sizes.h
|
|
* @brief Size definitions for the PSA Crypto API
|
|
*
|
|
* @author Armin Wolf <wolf.armin@mailbox.tu-dresden.de>
|
|
* @author Lena Boeckmann <lena.boeckmann@haw-hamburg.de>
|
|
*
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief Functions to convert bits to bytes
|
|
*
|
|
* @param bits
|
|
*
|
|
* @return Number of bytes contained in bits
|
|
*/
|
|
#define PSA_BITS_TO_BYTES(bits) (size_t)(((bits) + 7) / 8)
|
|
|
|
/**
|
|
* @brief Functions to convert bytes to bits
|
|
*
|
|
* @param bytes
|
|
*
|
|
* @return Number of bits contained in bytes
|
|
*/
|
|
#define PSA_BYTES_TO_BITS(bytes) ((bytes) * 8)
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
/** @} */
|