1 /* 2 * Copyright (c) 2017-2020 ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef _CC_PKA_HW_PLAT_DEFS_H 8 #define _CC_PKA_HW_PLAT_DEFS_H 9 10 #ifdef __cplusplus 11 extern "C" 12 { 13 #endif 14 15 16 #include "cc_pal_types.h" 17 /*! 18 @file 19 @brief Contains the enums and definitions that are used in the PKA code (definitions that are platform dependent). 20 */ 21 22 /*! The size of the PKA engine word. */ 23 #define CC_PKA_WORD_SIZE_IN_BITS 128 24 25 /*! The maximal supported size of modulus in RSA in bits. */ 26 #define CC_RSA_MAX_VALID_KEY_SIZE_VALUE_IN_BITS 4096 27 /*! The maximal supported size of key-generation in RSA in bits. */ 28 #define CC_RSA_MAX_KEY_GENERATION_HW_SIZE_BITS 4096 29 30 /*! Secure boot/debug certificate RSA public modulus key size in bits. */ 31 #if (KEY_SIZE == 3072) 32 #define BSV_CERT_RSA_KEY_SIZE_IN_BITS 3072 33 #else 34 #define BSV_CERT_RSA_KEY_SIZE_IN_BITS 2048 35 #endif 36 /*! Secure boot/debug certificate RSA public modulus key size in bytes. */ 37 #define BSV_CERT_RSA_KEY_SIZE_IN_BYTES (BSV_CERT_RSA_KEY_SIZE_IN_BITS/CC_BITS_IN_BYTE) 38 /*! Secure boot/debug certificate RSA public modulus key size in words. */ 39 #define BSV_CERT_RSA_KEY_SIZE_IN_WORDS (BSV_CERT_RSA_KEY_SIZE_IN_BITS/CC_BITS_IN_32BIT_WORD) 40 41 /*! The maximal count of extra bits in PKA operations. */ 42 #define PKA_EXTRA_BITS 8 43 /*! The number of memory registers in PKA operations. */ 44 #define PKA_MAX_COUNT_OF_PHYS_MEM_REGS 32 45 46 /*! Size of buffer for Barrett modulus tag in words. */ 47 #define RSA_PKA_BARRETT_MOD_TAG_BUFF_SIZE_IN_WORDS 5 48 /*! Size of buffer for Barrett modulus tag in bytes. */ 49 #define RSA_PKA_BARRETT_MOD_TAG_BUFF_SIZE_IN_BYTES (RSA_PKA_BARRETT_MOD_TAG_BUFF_SIZE_IN_WORDS*CC_32BIT_WORD_SIZE) 50 51 52 53 #ifdef __cplusplus 54 } 55 #endif 56 57 #endif //_CC_PKA_HW_PLAT_DEFS_H 58 59 /** 60 @} 61 */ 62 63