Initial commit

Initial commit.
This commit is contained in:
kntran1
2026-03-23 14:40:39 -05:00
parent e84b2b4166
commit 4e2a5258a5
872 changed files with 165227 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
#
# SPDX-License-Identifier: Apache-2.0
set(MBEDTLS_ASN1_DIR "${MCUBOOT_ROOT_DIR}/ext/mbedtls-asn1")
set(CRYPTO_INC
${MBEDTLS_ASN1_DIR}/include
)
set(crypto_srcs
# Additionally pull in just the ASN.1 parser from Mbed TLS.
${MBEDTLS_ASN1_DIR}/src/asn1parse.c
${MBEDTLS_ASN1_DIR}/src/platform_util.c
)
if (DEFINED CONFIG_ESP_USE_MBEDTLS)
message(FATAL_ERROR "EC256 signature verification using Mbed TLS lib is not supported")
elseif (DEFINED CONFIG_ESP_USE_TINYCRYPT)
set(TINYCRYPT_DIR ${MCUBOOT_ROOT_DIR}/ext/tinycrypt/lib)
list(APPEND CRYPTO_INC
${TINYCRYPT_DIR}/include
)
list(APPEND crypto_srcs
${ESPRESSIF_PORT_DIR}/keys.c
${TINYCRYPT_DIR}/source/utils.c
${TINYCRYPT_DIR}/source/sha256.c
${TINYCRYPT_DIR}/source/ecc.c
${TINYCRYPT_DIR}/source/ecc_dsa.c
)
endif()

View File

@@ -0,0 +1,31 @@
# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
#
# SPDX-License-Identifier: Apache-2.0
set(MBEDTLS_ASN1_DIR "${MCUBOOT_ROOT_DIR}/ext/mbedtls-asn1")
set(CRYPTO_INC
${MBEDTLS_ASN1_DIR}/include
)
set(crypto_srcs
# Additionally pull in just the ASN.1 parser from Mbed TLS.
${MBEDTLS_ASN1_DIR}/src/asn1parse.c
${MBEDTLS_ASN1_DIR}/src/platform_util.c
)
if (DEFINED CONFIG_ESP_USE_MBEDTLS)
message(FATAL_ERROR "ED25519 image signing using Mbed TLS lib is not supported")
elseif (DEFINED CONFIG_ESP_USE_TINYCRYPT)
set(TINYCRYPT_DIR ${MCUBOOT_ROOT_DIR}/ext/tinycrypt/lib)
set(TINYCRYPT512_DIR ${MCUBOOT_ROOT_DIR}/ext/tinycrypt-sha512/lib)
list(APPEND CRYPTO_INC
${TINYCRYPT_DIR}/include
${TINYCRYPT512_DIR}/include
)
list(APPEND crypto_srcs
${ESPRESSIF_PORT_DIR}/keys.c
${TINYCRYPT_DIR}/source/utils.c
${TINYCRYPT_DIR}/source/sha256.c
${TINYCRYPT512_DIR}/source/sha512.c
${MCUBOOT_ROOT_DIR}/ext/fiat/src/curve25519.c
)
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,28 @@
# Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
#
# SPDX-License-Identifier: Apache-2.0
if (DEFINED CONFIG_ESP_USE_MBEDTLS)
set(MBEDTLS_DIR ${MCUBOOT_ROOT_DIR}/ext/mbedtls)
set(CRYPTO_INC
${MBEDTLS_DIR}/include
)
set(crypto_srcs
${ESPRESSIF_PORT_DIR}/keys.c
${MBEDTLS_DIR}/library/platform.c
${MBEDTLS_DIR}/library/platform_util.c
${MBEDTLS_DIR}/library/sha256.c
${MBEDTLS_DIR}/library/rsa.c
${MBEDTLS_DIR}/library/bignum.c
${MBEDTLS_DIR}/library/asn1parse.c
${MBEDTLS_DIR}/library/md.c
${MBEDTLS_DIR}/library/memory_buffer_alloc.c
)
if (DEFINED MBEDTLS_CONFIG_FILE)
add_definitions(-DMBEDTLS_CONFIG_FILE=\"${MBEDTLS_CONFIG_FILE}\")
else()
add_definitions(-DMBEDTLS_CONFIG_FILE=\"${ESPRESSIF_PORT_DIR}/include/crypto_config/mbedtls_custom_config.h\")
endif()
elseif (DEFINED CONFIG_ESP_USE_TINYCRYPT)
message(FATAL_ERROR "RSA signature verification using Tinycrypt lib is not supported")
endif()