Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <assert.h> |
| 8 | #include <errno.h> |
| 9 | #include <stddef.h> |
| 10 | #include <stdint.h> |
| 11 | #include <string.h> |
| 12 | #include <services/rmmd_svc.h> |
| 13 | |
| 14 | static uint8_t sample_attest_priv_key[] = { |
| 15 | 0x20, 0x11, 0xC7, 0xF0, 0x3C, 0xEE, 0x43, 0x25, 0x17, 0x6E, |
| 16 | 0x52, 0x4F, 0x03, 0x3C, 0x0C, 0xE1, 0xE2, 0x1A, 0x76, 0xE6, |
| 17 | 0xC1, 0xA4, 0xF0, 0xB8, 0x39, 0xAA, 0x1D, 0xF6, 0x1E, 0x0E, |
| 18 | 0x8A, 0x5C, 0x8A, 0x05, 0x74, 0x0F, 0x9B, 0x69, 0xEF, 0xA7, |
| 19 | 0xEB, 0x1A, 0x41, 0x85, 0xBD, 0x11, 0x7F, 0x68 |
| 20 | }; |
| 21 | |
Javier Almansa Sobrino | 7176a77 | 2021-11-24 18:37:37 +0000 | [diff] [blame] | 22 | int plat_rmmd_get_cca_realm_attest_key(uintptr_t buf, size_t *len, |
| 23 | unsigned int type) |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 24 | { |
| 25 | assert(type == ATTEST_KEY_CURVE_ECC_SECP384R1); |
| 26 | |
| 27 | if (*len < sizeof(sample_attest_priv_key)) { |
| 28 | return -EINVAL; |
| 29 | } |
| 30 | |
| 31 | (void)memcpy((void *)buf, sample_attest_priv_key, |
| 32 | sizeof(sample_attest_priv_key)); |
| 33 | *len = sizeof(sample_attest_priv_key); |
| 34 | |
| 35 | return 0; |
| 36 | } |