blob: ee146cd72d8ed25358fb60bf4445975904c61323 [file] [log] [blame]
Almir Okatoeb6b7bf2021-09-07 17:06:35 -03001# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
2#
3# SPDX-License-Identifier: Apache-2.0
4
5if (DEFINED CONFIG_ESP_USE_MBEDTLS)
6 set(MBEDTLS_DIR ${MCUBOOT_ROOT_DIR}/ext/mbedtls)
7 set(CRYPTO_INC
8 ${MBEDTLS_DIR}/include
9 )
10 set(crypto_srcs
11 ${ESPRESSIF_PORT_DIR}/keys.c
12 ${MBEDTLS_DIR}/library/platform.c
13 ${MBEDTLS_DIR}/library/platform_util.c
14 ${MBEDTLS_DIR}/library/sha256.c
15 ${MBEDTLS_DIR}/library/rsa.c
16 ${MBEDTLS_DIR}/library/bignum.c
17 ${MBEDTLS_DIR}/library/asn1parse.c
Antonio de Angelis02bf0722022-11-22 15:35:43 +000018 ${MBEDTLS_DIR}/library/md.c
Almir Okatoeb6b7bf2021-09-07 17:06:35 -030019 ${MBEDTLS_DIR}/library/memory_buffer_alloc.c
20 )
21 if (DEFINED MBEDTLS_CONFIG_FILE)
22 add_definitions(-DMBEDTLS_CONFIG_FILE=\"${MBEDTLS_CONFIG_FILE}\")
23 else()
24 add_definitions(-DMBEDTLS_CONFIG_FILE=\"${ESPRESSIF_PORT_DIR}/include/crypto_config/mbedtls_custom_config.h\")
25 endif()
26elseif (DEFINED CONFIG_ESP_USE_TINYCRYPT)
27 message(FATAL_ERROR "RSA signature verification using Tinycrypt lib is not supported")
28endif()