blob: 6db596e0d78519eb954df9e95b8042c0e06d9511 [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 _SECURE_BOOT_BASE_FUNC_H
8#define _SECURE_BOOT_BASE_FUNC_H
9
10
11#ifdef __cplusplus
12extern "C"
13{
14#endif
15
16#include "cc_pal_types.h"
17#include "secureboot_gen_defs.h"
18
19
20/*----------------------------
21 PUBLIC FUNCTIONS
22-----------------------------------*/
23
24/**
25 * @brief This function calculates the HASH over the given data and than verify
26 * RSA signature on that hashed data
27 *
28 * @param[in] hwBaseAddr - CryptoCell base address
29 * @param[in] pData - pointer to the data to be verified
30 * @param[in] pNParams - a pointer to the public key parameters
31 * @param[in] pSignature - a pointer to the signature structure
32 * @param[in] sizeOfData - size of the data to calculate the HASH on (in bytes)
33 * @param[in] RSAAlg - RSA algorithm to use
34 *
35 * @return CCError_t - On success the value CC_OK is returned,
36 * on failure - a value from BootImagesVerifier_error.h
37 */
38CCError_t CCSbVerifySignature(unsigned long hwBaseAddress,
39 uint32_t *pData,
40 CCSbNParams_t *pNParams,
41 CCSbSignature_t *pSignature,
42 uint32_t sizeOfData,
43 CCSbRsaAlg_t RSAAlg);
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif