1 /* 2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef _NVM__H 8 #define _NVM__H 9 10 #ifdef __cplusplus 11 extern "C" 12 { 13 #endif 14 15 #include "cc_crypto_boot_defs.h" 16 #include "cc_pal_types.h" 17 #include "cc_sec_defs.h" 18 19 /*------------------------------------ 20 DEFINES 21 -------------------------------------*/ 22 23 /** 24 * @brief This function reads the LCS from the SRAM/NVM 25 * 26 * @param[in] hwBaseAddress - CryptoCell base address 27 * 28 * @param[in/out] lcs_ptr - pointer to memory to store the LCS 29 * 30 * @return CCError_t - On success the value CC_OK is returned, and on failure -a value from NVM_error.h 31 */ 32 CCError_t NVM_GetLCS(unsigned long hwBaseAddress, uint32_t *lcs_ptr); 33 34 /** 35 * @brief The NVM_ReadHASHPubKey function is a NVM interface function - 36 * The function retrieves the HASH of the device Public key from the SRAM/NVM 37 * 38 * @param[in] hwBaseAddress - CryptoCell base address 39 * 40 * @param[in] pubKeyIndex - Index of HASH in the OTP 41 * 42 * @param[out] PubKeyHASH - the public key HASH. 43 * 44 * @param[in] hashSizeInWords - hash size (valid values: 4W, 8W) 45 * 46 * @return CCError_t - On success the value CC_OK is returned, and on failure -a value from NVM_error.h 47 */ 48 49 CCError_t NVM_ReadHASHPubKey(unsigned long hwBaseAddress, CCSbPubKeyIndexType_t pubKeyIndex, CCHashResult_t PubKeyHASH, uint32_t hashSizeInWords); 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif 56