xref: /rk3399_ARM-atf/plat/arm/board/fvp/fvp_realm_attest_key.c (revision a1901c7d0d05ac02b254bf215fb889b9c0a9bc7d)
1a0435105SSoby Mathew /*
2d679cdecSManish V Badarkhe  * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
3a0435105SSoby Mathew  *
4a0435105SSoby Mathew  * SPDX-License-Identifier: BSD-3-Clause
5a0435105SSoby Mathew  */
6a0435105SSoby Mathew 
7eb8700a9SManish V Badarkhe #include <errno.h>
8eb8700a9SManish V Badarkhe #include <string.h>
9eb8700a9SManish V Badarkhe 
10eb8700a9SManish V Badarkhe #include <plat/common/platform.h>
11eb8700a9SManish V Badarkhe 
12eb8700a9SManish V Badarkhe static const uint8_t sample_delegated_key[] = {
13eb8700a9SManish V Badarkhe 	0x20, 0x11, 0xC7, 0xF0, 0x3C, 0xEE, 0x43, 0x25, 0x17, 0x6E,
14eb8700a9SManish V Badarkhe 	0x52, 0x4F, 0x03, 0x3C, 0x0C, 0xE1, 0xE2, 0x1A, 0x76, 0xE6,
15eb8700a9SManish V Badarkhe 	0xC1, 0xA4, 0xF0, 0xB8, 0x39, 0xAA, 0x1D, 0xF6, 0x1E, 0x0E,
16eb8700a9SManish V Badarkhe 	0x8A, 0x5C, 0x8A, 0x05, 0x74, 0x0F, 0x9B, 0x69, 0xEF, 0xA7,
17eb8700a9SManish V Badarkhe 	0xEB, 0x1A, 0x41, 0x85, 0xBD, 0x11, 0x7F, 0x68
18eb8700a9SManish V Badarkhe };
19a0435105SSoby Mathew 
20d679cdecSManish V Badarkhe /*
21eb8700a9SManish V Badarkhe  * Get the hardcoded delegated realm attestation key as FVP
22*a822b8d8STamas Ban  * does not support RSE.
23d679cdecSManish V Badarkhe  */
plat_rmmd_get_cca_realm_attest_key(uintptr_t buf,size_t * len,unsigned int type)248c980a4aSJavier Almansa Sobrino int plat_rmmd_get_cca_realm_attest_key(uintptr_t buf, size_t *len,
258c980a4aSJavier Almansa Sobrino 				       unsigned int type)
26a0435105SSoby Mathew {
27eb8700a9SManish V Badarkhe 	if (*len < sizeof(sample_delegated_key)) {
28eb8700a9SManish V Badarkhe 		return -EINVAL;
29eb8700a9SManish V Badarkhe 	}
30d679cdecSManish V Badarkhe 
31eb8700a9SManish V Badarkhe 	(void)memcpy((void *)buf, (const void *)sample_delegated_key,
32eb8700a9SManish V Badarkhe 		     sizeof(sample_delegated_key));
33eb8700a9SManish V Badarkhe 	*len = sizeof(sample_delegated_key);
34a0435105SSoby Mathew 
35eb8700a9SManish V Badarkhe 	return 0;
36a0435105SSoby Mathew }
37