Skip to content

Commit 087daea

Browse files
committed
M467: Support Crypto ECC H/W in full-module replacement
1. Replace ecp.c full-module, and other ec modules dependent on ecp.c (ecdh.c/ecdsa.c/ecjpake.c) will improve followingly. 2. Recover from Crypto ECC H/W failure: (1) Enable timed-out wait to escape from ECC H/W trap (2) On ECC H/W timeout, stop this ECC H/W operation (3) Fall back to S/W implementation on failure 3. Support Short Weierstrass curve 4. Support Montgomery curve Montgomery curve has the form: B y^2 = x^3 + A x^2 + x (1) In S/W impl, A is used as (A + 2) / 4. Figure out its original value for engine. https://github.com/ARMmbed/mbed-os/blob/2eb06e76208588afc6cb7580a8dd64c5429a10ce/connectivity/mbedtls/include/mbedtls/ecp.h#L219-L220 (2) In S/W impl, B is unused. Actually, B is 1 for Curve25519/Curve448 and needs to configure to engine. https://github.com/ARMmbed/mbed-os/blob/2eb06e76208588afc6cb7580a8dd64c5429a10ce/connectivity/mbedtls/include/mbedtls/ecp.h#L221-L222 (3) In S/W impl, y-coord is absent, but engine needs it. Deduce it from x-coord following: https://tools.ietf.org/id/draft-jivsov-ecc-compact-05.html https://www.rieselprime.de/ziki/Modular_square_root NOTE: Fix Curve448 has wrong order value Mbed-TLS/mbedtls#5811
1 parent a430d70 commit 087daea

File tree

10 files changed

+6449
-526
lines changed

10 files changed

+6449
-526
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ target_include_directories(mbed-mbedtls
1515
target_sources(mbed-mbedtls
1616
INTERFACE
1717
aes/aes_alt.c
18+
ecp/crypto_ecc_hw.c
19+
ecp/ecp_alt.c
20+
ecp/ecp_curves_alt.c
21+
ecp/ecp_helper.c
1822
ecp/ecp_internal_alt.c
1923
rsa/crypto_rsa_hw.c
2024
rsa/rsa_alt.c

0 commit comments

Comments
 (0)