-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from mswarowsky/tfm_20_upmerge
mbedTLS v3.5.0 upmerge for TF-M v2.0.0
- Loading branch information
Showing
759 changed files
with
130,688 additions
and
57,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/mbedtls_config.h get MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED RESULT_VARIABLE result) | ||
|
||
if(${result} EQUAL 0) | ||
add_subdirectory(everest) | ||
endif() | ||
add_subdirectory(everest) | ||
add_subdirectory(p256-m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
THIRDPARTY_DIR = $(dir $(lastword $(MAKEFILE_LIST))) | ||
THIRDPARTY_DIR = $(dir $(word 2, $(MAKEFILE_LIST))) | ||
include $(THIRDPARTY_DIR)/everest/Makefile.inc | ||
include $(THIRDPARTY_DIR)/p256-m/Makefile.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
*.o | ||
Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
set(p256m_target ${MBEDTLS_TARGET_PREFIX}p256m) | ||
|
||
add_library(${p256m_target} | ||
p256-m_driver_entrypoints.c | ||
p256-m/p256-m.c) | ||
|
||
target_include_directories(${p256m_target} | ||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/p256-m> | ||
$<BUILD_INTERFACE:${MBEDTLS_DIR}/include> | ||
$<INSTALL_INTERFACE:include> | ||
PRIVATE ${MBEDTLS_DIR}/library/) | ||
|
||
# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE | ||
# This must be duplicated from library/CMakeLists.txt because | ||
# p256m is not directly linked against any mbedtls targets | ||
# so does not inherit the compile definitions. | ||
if(MBEDTLS_CONFIG_FILE) | ||
target_compile_definitions(p256m | ||
PUBLIC MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}") | ||
endif() | ||
if(MBEDTLS_USER_CONFIG_FILE) | ||
target_compile_definitions(p256m | ||
PUBLIC MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}") | ||
endif() | ||
|
||
if(INSTALL_MBEDTLS_HEADERS) | ||
|
||
install(DIRECTORY :${CMAKE_CURRENT_SOURCE_DIR} | ||
DESTINATION include | ||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ | ||
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE | ||
FILES_MATCHING PATTERN "*.h") | ||
|
||
endif(INSTALL_MBEDTLS_HEADERS) | ||
|
||
install(TARGETS ${p256m_target} | ||
EXPORT MbedTLSTargets | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
THIRDPARTY_INCLUDES+=-I../3rdparty/p256-m/p256-m/include -I../3rdparty/p256-m/p256-m/include/p256-m -I../3rdparty/p256-m/p256-m_driver_interface | ||
|
||
THIRDPARTY_CRYPTO_OBJECTS+= \ | ||
../3rdparty/p256-m//p256-m_driver_entrypoints.o \ | ||
../3rdparty/p256-m//p256-m/p256-m.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The files within the `p256-m/` subdirectory originate from the [p256-m GitHub repository](https://github.com/mpg/p256-m), which is distributed under the Apache 2.0 license. They are authored by Manuel Pégourié-Gonnard. p256-m is a minimalistic implementation of ECDH and ECDSA on NIST P-256, especially suited to constrained 32-bit environments. Mbed TLS documentation for integrating drivers uses p256-m as an example of a software accelerator, and describes how it can be integrated alongside Mbed TLS. It should be noted that p256-m files in the Mbed TLS repo will not be updated regularly, so they may not have fixes and improvements present in the upstream project. | ||
|
||
The files `p256-m.c` and `.h`, along with the license, have been taken from the `p256-m` repository. | ||
It should be noted that p256-m deliberately does not supply its own cryptographically secure RNG function. As a result, the PSA RNG is used, with `p256_generate_random()` wrapping `psa_generate_random()`. |
Oops, something went wrong.