Skip to content

Commit 88a5291

Browse files
committed
M467: Support Crypto RSA H/W
1. Crypto RSA H/W supports 1024/2048/3072/4096 key bits. Fall back to software implementation for other key bits. 2. For decrypt, if MBEDTLS_RSA_NO_CRT isn't defined, go CRT, or normal. 3. For decrypt, when blinding (f_rng != NULL), enable SCAP mode. 4. Recover from Crypto RSA H/W failure: (1) Enable timed-out wait to escape from RSA H/W trap (2) On RSA H/W timeout, stop this RSA H/W operation (3) Fall back to S/W implementation on failure NOTE: RSA 4096 key bits can fail with default mbedtls configuration MBEDTLS_MPI_MAX_SIZE. Enlarge MBEDTLS_MPI_MAX_SIZE to 1024 or larger if this feature is required. NOTE: Fixed in BSP RSA driver, for non-CRT+SCAP mode, temporary buffer for MADDR6 requires to be key length plus 128 bits. NOTE: Fixed in BSP RSA driver, DMA buffer must be 4-word aligned, or RSA H/W will trap.
1 parent 21970e3 commit 88a5291

File tree

7 files changed

+3345
-39
lines changed

7 files changed

+3345
-39
lines changed

connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M460/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ target_sources(mbed-mbedtls
1515
INTERFACE
1616
aes/aes_alt.c
1717
ecp/ecp_internal_alt.c
18+
rsa/crypto_rsa_hw.c
1819
rsa/rsa_alt.c
1920
sha/sha1_alt.c
2021
sha/sha256_alt.c

connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M460/mbedtls_device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@
3838
#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT
3939
#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT
4040

41-
//#define MBEDTLS_RSA_ALT
41+
#define MBEDTLS_RSA_ALT
4242

4343
#endif /* MBEDTLS_DEVICE_H */

0 commit comments

Comments
 (0)