Skip to content

Commit e8dd9f4

Browse files
committed
M467: Make mbedtls H/W port removable
Some M460 chips don't support AES/SHA/ECC/RSA H/W. Make them removable from mbedtls H/W port through '"target.macros_remove": ["MBEDTLS_CONFIG_HW_SUPPORT"]'.
1 parent 1dd9546 commit e8dd9f4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

targets/TARGET_NUVOTON/TARGET_M460/crypto/crypto-misc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include "platform/PlatformMutex.h"
3131
#include "hal/trng_api.h"
3232

33+
#if defined(MBEDTLS_CONFIG_HW_SUPPORT)
34+
3335
/* Consideration for choosing proper synchronization mechanism
3436
*
3537
* We choose mutex to synchronize access to crypto ACC. We can guarantee:
@@ -461,3 +463,5 @@ extern "C" void CRPT_IRQHandler()
461463
RSA_CLR_INT_FLAG(CRPT);
462464
}
463465
}
466+
467+
#endif /* #if defined(MBEDTLS_CONFIG_HW_SUPPORT) */

targets/TARGET_NUVOTON/TARGET_M460/crypto/crypto-misc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
#include <stdbool.h>
2323

24+
#if defined(MBEDTLS_CONFIG_HW_SUPPORT)
25+
2426
#ifdef __cplusplus
2527
extern "C" {
2628
#endif
@@ -100,4 +102,6 @@ bool crypto_dma_buffs_overlap(const void *in_buff, size_t in_buff_size, const vo
100102
}
101103
#endif
102104

105+
#endif /* #if defined(MBEDTLS_CONFIG_HW_SUPPORT) */
106+
103107
#endif

0 commit comments

Comments
 (0)