Soby Mathew | 1ae83bc | 2017-05-10 11:48:40 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef _SECURE_BOOT_GEN_DEFS_H |
| 8 | #define _SECURE_BOOT_GEN_DEFS_H |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" |
| 12 | { |
| 13 | #endif |
| 14 | |
| 15 | /*! @file |
| 16 | @brief This file contains all of the definitions and structures that are used for the secure boot. |
| 17 | */ |
| 18 | |
| 19 | #include "cc_pal_sb_plat.h" |
| 20 | #include "cc_sec_defs.h" |
| 21 | |
| 22 | |
| 23 | /* General definitions */ |
| 24 | /***********************/ |
| 25 | |
| 26 | /*RSA definitions*/ |
| 27 | #define SB_RSA_MOD_SIZE_IN_WORDS 64 |
| 28 | #define SB_RSA_HW_PKI_PKA_BARRETT_MOD_TAG_SIZE_IN_WORDS 5 |
| 29 | |
| 30 | |
| 31 | /*! Public key data structure. */ |
| 32 | typedef struct { |
| 33 | uint32_t N[SB_RSA_MOD_SIZE_IN_WORDS]; /*!< N public key, big endian representation. */ |
| 34 | uint32_t Np[SB_RSA_HW_PKI_PKA_BARRETT_MOD_TAG_SIZE_IN_WORDS]; /*!< Np (Barrett n' value). */ |
| 35 | } CCSbNParams_t; |
| 36 | |
| 37 | /*! Signature structure. */ |
| 38 | typedef struct { |
| 39 | uint32_t sig[SB_RSA_MOD_SIZE_IN_WORDS]; /*!< RSA PSS signature. */ |
| 40 | } CCSbSignature_t; |
| 41 | |
| 42 | |
| 43 | /********* Supported algorithms definitions ***********/ |
| 44 | |
| 45 | /*! RSA supported algorithms */ |
| 46 | typedef enum { |
| 47 | RSA_PSS_2048 = 0x01, /*!< RSA PSS 2048 after hash SHA 256 */ |
| 48 | RSA_PKCS15_2048 = 0x02, /*!< RSA PKX15 */ |
| 49 | RSA_Last = 0x7FFFFFFF |
| 50 | } CCSbRsaAlg_t; |
| 51 | |
| 52 | #ifdef __cplusplus |
| 53 | } |
| 54 | #endif |
| 55 | |
| 56 | #endif |