mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 18:14:24 +00:00

commit (a8eadc51a
refactor(mbedtls): avoid including
MBEDTLS_CONFIG_FILE) avoids using config file directly and relies on
config file usage from mbedtls version.h
But we could build trusted boot without mbedtls dir so guard version.h
include in cot_def.h with availability of config file.
Also we refactored in same commit to break dependencies between
auth_mod.h and cot_def.h, So add cot_def.h include in nxp tbbr
cot file.
Change-Id: I4779e90c18f04c73d2121c88df6420b4b1109c8b
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
62 lines
1.7 KiB
C
62 lines
1.7 KiB
C
/*
|
|
* Copyright (c) 2015-2023, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef COT_DEF_H
|
|
#define COT_DEF_H
|
|
|
|
/*
|
|
* Guard here with availability of mbedtls config since PLAT=lx2162aqds
|
|
* uses custom tbbr from 'drivers/nxp/auth/tbbr/tbbr_cot.c' and also may
|
|
* build without mbedtls folder only with TRUSTED_BOOT enabled.
|
|
*/
|
|
#ifdef MBEDTLS_CONFIG_FILE
|
|
#include <mbedtls/version.h>
|
|
#endif
|
|
|
|
/* TBBR CoT definitions */
|
|
#if defined(SPD_spmd)
|
|
#define COT_MAX_VERIFIED_PARAMS 8
|
|
#elif defined(ARM_COT_cca)
|
|
#define COT_MAX_VERIFIED_PARAMS 8
|
|
#else
|
|
#define COT_MAX_VERIFIED_PARAMS 4
|
|
#endif
|
|
|
|
/*
|
|
* Maximum key and hash sizes (in DER format).
|
|
*
|
|
* Both RSA and ECDSA keys may be used at the same time. In this case, the key
|
|
* buffers must be big enough to hold either. As RSA keys are bigger than ECDSA
|
|
* ones for all key sizes we support, they impose the minimum size of these
|
|
* buffers.
|
|
*/
|
|
#if TF_MBEDTLS_USE_RSA
|
|
#if TF_MBEDTLS_KEY_SIZE == 1024
|
|
#define PK_DER_LEN 162
|
|
#elif TF_MBEDTLS_KEY_SIZE == 2048
|
|
#define PK_DER_LEN 294
|
|
#elif TF_MBEDTLS_KEY_SIZE == 3072
|
|
#define PK_DER_LEN 422
|
|
#elif TF_MBEDTLS_KEY_SIZE == 4096
|
|
#define PK_DER_LEN 550
|
|
#else
|
|
#error "Invalid value for TF_MBEDTLS_KEY_SIZE"
|
|
#endif
|
|
#else /* Only using ECDSA keys. */
|
|
#define PK_DER_LEN 92
|
|
#endif
|
|
|
|
#if TF_MBEDTLS_HASH_ALG_ID == TF_MBEDTLS_SHA256
|
|
#define HASH_DER_LEN 51
|
|
#elif TF_MBEDTLS_HASH_ALG_ID == TF_MBEDTLS_SHA384
|
|
#define HASH_DER_LEN 67
|
|
#elif TF_MBEDTLS_HASH_ALG_ID == TF_MBEDTLS_SHA512
|
|
#define HASH_DER_LEN 83
|
|
#else
|
|
#error "Invalid value for TF_MBEDTLS_HASH_ALG_ID"
|
|
#endif
|
|
|
|
#endif /* COT_DEF_H */
|