1+ /*
2+ * SPDX-License-Identifier: Apache-2.0
3+ *
4+ * Copyright (c) 2018-2019 JUUL Labs
5+ * Copyright (c) 2019 Arm Limited
6+ * Copyright (c) 2021 Nordic Semiconductor ASA
7+ *
8+ * Original license:
9+ *
10+ * Licensed to the Apache Software Foundation (ASF) under one
11+ * or more contributor license agreements. See the NOTICE file
12+ * distributed with this work for additional information
13+ * regarding copyright ownership. The ASF licenses this file
14+ * to you under the Apache License, Version 2.0 (the
15+ * "License"); you may not use this file except in compliance
16+ * with the License. You may obtain a copy of the License at
17+ *
18+ * http://www.apache.org/licenses/LICENSE-2.0
19+ *
20+ * Unless required by applicable law or agreed to in writing,
21+ * software distributed under the License is distributed on an
22+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+ * KIND, either express or implied. See the License for the
24+ * specific language governing permissions and limitations
25+ * under the License.
26+ */
27+
28+ #ifndef BOOTUTIL_ENC_KEY_PUBLIC_H
29+ #define BOOTUTIL_ENC_KEY_PUBLIC_H
30+ #include <mcuboot_config/mcuboot_config.h>
31+ #ifdef __cplusplus
32+ extern "C" {
33+ #endif
34+
35+ #define BOOT_ENC_KEY_SIZE 16
36+
37+ #define TLV_ENC_RSA_SZ 256
38+ #define TLV_ENC_KW_SZ 24
39+ #define TLV_ENC_EC256_SZ (65 + 32 + 16)
40+ #define TLV_ENC_X25519_SZ (32 + 32 + 16)
41+
42+ #if defined(MCUBOOT_ENCRYPT_RSA )
43+ #define BOOT_ENC_TLV_SIZE TLV_ENC_RSA_SZ
44+ #elif defined(MCUBOOT_ENCRYPT_EC256 )
45+ #define BOOT_ENC_TLV_SIZE TLV_ENC_EC256_SZ
46+ #elif defined(MCUBOOT_ENCRYPT_X25519 )
47+ #define BOOT_ENC_TLV_SIZE TLV_ENC_X25519_SZ
48+ #else
49+ #define BOOT_ENC_TLV_SIZE TLV_ENC_KW_SZ
50+ #endif
51+
52+ #ifdef __cplusplus
53+ }
54+ #endif
55+
56+ #endif /* BOOTUTIL_ENC_KEY_PUBLIC_H */
0 commit comments