diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/aes/aes_alt.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/aes/aes_alt.c index 6df2663d16..ff59e66237 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/aes/aes_alt.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/aes/aes_alt.c @@ -21,6 +21,9 @@ * http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -588,3 +591,5 @@ int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx, #endif /* MBEDTLS_AES_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt.c index fb75266a36..3643ffd691 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt.c @@ -14,6 +14,9 @@ * limitations under the License. */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -408,3 +411,5 @@ static int mbedtls_des_docrypt(uint16_t keyopt, uint8_t key[3][MBEDTLS_DES_KEY_S #endif /* MBEDTLS_DES_ALT */ #endif /* MBEDTLS_DES_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt_sw.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt_sw.c index 1e51151c86..59a94d0164 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt_sw.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt_sw.c @@ -25,6 +25,9 @@ * http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -795,3 +798,5 @@ int mbedtls_des3_sw_crypt_cbc( mbedtls_des3_sw_context *ctx, #endif /* MBEDTLS_DES_ALT */ #endif /* MBEDTLS_DES_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt.c index de6ff01415..dfa8cda864 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt.c @@ -14,6 +14,9 @@ * limitations under the License. */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -136,3 +139,5 @@ void mbedtls_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64 #endif /* MBEDTLS_SHA1_ALT */ #endif /* MBEDTLS_SHA1_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt_sw.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt_sw.c index 230c872465..18b0c496c6 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt_sw.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt_sw.c @@ -24,6 +24,9 @@ * http://www.itl.nist.gov/fipspubs/fip180-1.htm */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -343,3 +346,5 @@ void mbedtls_sha1_sw_finish( mbedtls_sha1_sw_context *ctx, unsigned char output[ #endif /* MBEDTLS_SHA1_ALT */ #endif /* MBEDTLS_SHA1_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt.c index e5fd727e2a..f62f0e2810 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt.c @@ -14,6 +14,9 @@ * limitations under the License. */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -137,3 +140,5 @@ void mbedtls_sha256_process(mbedtls_sha256_context *ctx, const unsigned char dat #endif /* MBEDTLS_SHA256_ALT */ #endif /* MBEDTLS_SHA256_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt_sw.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt_sw.c index 3ac2b61317..a6db9b136b 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt_sw.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt_sw.c @@ -24,6 +24,9 @@ * http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -317,3 +320,5 @@ void mbedtls_sha256_sw_finish( mbedtls_sha256_sw_context *ctx, unsigned char out #endif /* MBEDTLS_SHA256_ALT */ #endif /* MBEDTLS_SHA256_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */ diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha_alt_hw.c b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha_alt_hw.c index 4f26b808d5..2eb7536959 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha_alt_hw.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha_alt_hw.c @@ -14,6 +14,9 @@ * limitations under the License. */ +/* Compatible with mbed OS 2 which doesn't support mbedtls */ +#if MBED_CONF_RTOS_PRESENT + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else @@ -331,3 +334,5 @@ void crypto_sha_getinternstate(unsigned char output[], size_t olen) #endif /* MBEDTLS_SHA1_ALT || MBEDTLS_SHA256_ALT || MBEDTLS_SHA512_ALT */ #endif /* MBEDTLS_SHA1_C || MBEDTLS_SHA256_C || MBEDTLS_SHA512_C */ + +#endif /* MBED_CONF_RTOS_PRESENT */