Skip to content

Commit

Permalink
Merge pull request #15289 from OpenNuvoton/nuvoton_m487_des_ecp
Browse files Browse the repository at this point in the history
M487: Fix crypto h/w port
  • Loading branch information
0xc0170 authored May 30, 2022
2 parents 1ab98de + b402c97 commit b6fadd3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static int mbedtls_des_docrypt(uint16_t keyopt, uint8_t key[3][MBEDTLS_DES_KEY_S
* 1. BE for byte sequence in word
* 2. BE for word sequence in double-word
*/
TDES_Open(CRPT
TDES_Open(CRPT,
0, // Channel number (0~4)
enc, // 0: decode, 1: encode
(tdes_opmode & CRPT_TDES_CTL_TMODE_Msk) ? 1 : 0, // 0: DES, 1: TDES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ NU_STATIC int internal_run_eccop(const mbedtls_ecp_group *grp,
return MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED;
}

/* NOTE: Engine doesn't support P + Q when P and Q are the same. Workaround by 2*P */
if (mbedtls_ecp_point_cmp(P, Q) == 0) {
return internal_run_eccop(grp, R, NULL, P, NULL, NULL, ECCOP_POINT_DOUBLE);
}

int ret;
bool ecc_done;

Expand Down

0 comments on commit b6fadd3

Please sign in to comment.