blob: c1e4de47e297e8c0f0e061fbe42634d29906bf1f [file] [log] [blame]
Jamie Foxab30e712023-03-30 17:48:36 +01001/*
2 * Copyright (c) 2023, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __DPE_IMPL_H__
9#define __DPE_IMPL_H__
10
11#include <stdbool.h>
12#include <stddef.h>
13#include <stdint.h>
14
15#include "dice_protection_environment.h"
16#include "ext/dice/dice.h"
17#include "psa/crypto.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/* The maximum supported public key size is for a 384-bit ECC curve */
24#define DPE_PUBLIC_KEY_MAX_SIZE PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(384)
25
26/* The maximum certificate chain size that can be output by this
27 * implementation
28 */
29#define DPE_CERTIFICATE_CHAIN_MAX_SIZE 2048
30
Jamie Foxab30e712023-03-30 17:48:36 +010031/* Internal DPE service implementation of dpe_certify_key() */
32dpe_error_t dpe_certify_key_impl(int context_handle,
33 bool retain_context,
34 const uint8_t *public_key,
35 size_t public_key_size,
36 const uint8_t *label,
37 size_t label_size,
38 uint8_t *certificate_chain_buf,
39 size_t certificate_chain_buf_size,
40 size_t *certificate_chain_actual_size,
41 uint8_t *derived_public_key_buf,
42 size_t derived_public_key_buf_size,
43 size_t *derived_public_key_actual_size,
44 int *new_context_handle);
45
46#ifdef __cplusplus
47}
48#endif
49
50#endif /* __DPE_IMPL_H__ */