blob: a70289fb89bb8339f151296b3c7a8ca196ab682d [file] [log] [blame]
Soby Mathew1ae83bc2017-05-10 11:48:40 +01001/*
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
11extern "C"
12{
13#endif
14
15#include "cc_crypto_boot_defs.h"
Soby Mathew1ae83bc2017-05-10 11:48:40 +010016#include "cc_pal_types.h"
Isla Mitchell99305012017-07-11 14:54:08 +010017#include "cc_sec_defs.h"
Soby Mathew1ae83bc2017-05-10 11:48:40 +010018
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 */
32CCError_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
49CCError_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