Almir Okato | eb6b7bf | 2021-09-07 17:06:35 -0300 | [diff] [blame^] | 1 | # Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd. |
| 2 | # |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | if (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 |
| 18 | ${MBEDTLS_DIR}/library/memory_buffer_alloc.c |
| 19 | ) |
| 20 | if (DEFINED MBEDTLS_CONFIG_FILE) |
| 21 | add_definitions(-DMBEDTLS_CONFIG_FILE=\"${MBEDTLS_CONFIG_FILE}\") |
| 22 | else() |
| 23 | add_definitions(-DMBEDTLS_CONFIG_FILE=\"${ESPRESSIF_PORT_DIR}/include/crypto_config/mbedtls_custom_config.h\") |
| 24 | endif() |
| 25 | elseif (DEFINED CONFIG_ESP_USE_TINYCRYPT) |
| 26 | message(FATAL_ERROR "RSA signature verification using Tinycrypt lib is not supported") |
| 27 | endif() |