blob: 5a5fe0a90baceb4ceb2cd256389b586a91bd552b [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
31/* Internal DPE service implementation of dpe_derive_child() */
32dpe_error_t dpe_derive_child_impl(int context_handle,
33 bool retain_parent_context,
34 bool allow_child_to_derive,
35 bool create_certificate,
36 const DiceInputValues *dice_inputs,
37 int *child_context_handle,
38 int *new_context_handle);
39
40/* Internal DPE service implementation of dpe_certify_key() */
41dpe_error_t dpe_certify_key_impl(int context_handle,
42 bool retain_context,
43 const uint8_t *public_key,
44 size_t public_key_size,
45 const uint8_t *label,
46 size_t label_size,
47 uint8_t *certificate_chain_buf,
48 size_t certificate_chain_buf_size,
49 size_t *certificate_chain_actual_size,
50 uint8_t *derived_public_key_buf,
51 size_t derived_public_key_buf_size,
52 size_t *derived_public_key_actual_size,
53 int *new_context_handle);
54
55#ifdef __cplusplus
56}
57#endif
58
59#endif /* __DPE_IMPL_H__ */