Commit Graph

8 Commits (refactor_hal_greentea_cmake)

Author SHA1 Message Date
Lingkai Dong fbca8e9c84 platform_mbed.h: Fix and align EXPERIMENTAL_API check
Some of the lines in `platform_mbed.h` only have `FEATURE_PSA`
checked, which is always set for Mbed OS PSA targets but the PSA
APIs are not actually available unless `FEATURE_EXPERIMENTAL_API`
is also enabled. To fix this and improve readability, group all
PSA-related lines and check both macros.
2021-06-28 11:46:57 +01:00
Martin Kojtal fd7e33b361
Merge pull request #14772 from LDong-Arm/mbedtls_timing
Improve implementation of Mbed TLS timing
2021-06-15 13:09:49 +02:00
Lingkai Dong f96f98e60e mbedtls: Use LowPowerTimer/Timer for timing
Previously we used `gettimeofday()` for Mbed TLS timing, but its
implementation provided by Mbed OS is only precise to seconds. The
microsecond component of the output `struct timeval` is always set
to zero. But Mbed TLS requires millisecond precision.

To provide required timing precision, switch to use `LowPowerTicker`
or (microsecond) `Ticker`. `LowPowerTicker` is preferred as it saves
power and Mbed TLS does not require microsecond precision.
2021-06-14 17:25:08 +01:00
Martin Kojtal 1606b00186
Merge pull request #14741 from boraozgen/trng-def-checks
MbedTLS: Add definition checks for TRNG
2021-06-14 12:05:16 +02:00
Jaeden Amero b8781e527b mbedtls: Add an alt implementation of timing
Implement the MBEDTLS_TIMING_ALT interface for Mbed OS. This
implementation is sufficient to run the Mbed TLS benchmarking
application.
2021-06-09 17:43:18 +01:00
Bora Özgen eabc477f3c MbedTLS: Add definition checks for TRNG
The compiler gave redefinition warnings if
MBEDTLS_ENTROPY_HARDWARE_ALT is defined in the the compile
definitions. A check is added to prevent this warning.
2021-06-07 15:40:46 +02:00
Jaeden Amero 2300a56863 mbedtls: Don't attempt to use default_random_seed
Don't attempt to use default_random_seed unless both PSA and Experimental API
support are enabled. This prevents errors when the Mbed TLS NV Seed feature is
being used on platforms that have PSA enabled by default, but not Experimental
API support by default.

    [DEBUG] Output: compilation terminated.
    [ERROR] In file included from ./mbed-os/connectivity/mbedtls/include/mbedtls/config.h:31,
                     from ./mbed-os/connectivity/mbedtls/include/mbedtls/entropy.h:28,
    ./mbed-os/connectivity/mbedtls/platform/inc/platform_mbed.h:26:10: fatal error: default_random_seed.h: No such file or directory
       26 | #include "default_random_seed.h"
2021-05-04 13:56:54 +01:00
George Psimenos c8cc5bd180 Move mbedtls 2020-08-11 11:32:08 +01:00