Skip to content

Commit 406d480

Browse files
committed
[M487] Change return error code to MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED when ECC H/W acceleratioin is failed
MBEDTLS_ERR_SSL_HW_ACCEL_FAILED is for hardware accelerators that do TLS record processing. Replace it with MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED when ECC H/W acceleratioin is failed.
1 parent 550e762 commit 406d480

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

features/mbedtls/targets/TARGET_NUVOTON/TARGET_M480/ecp/ecp_internal_alt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ NU_STATIC int internal_run_eccop(const mbedtls_ecp_group *grp,
684684
CRPT->ECC_CTL = (grp->pbits << CRPT_ECC_CTL_CURVEM_Pos) | eccop | CRPT_ECC_CTL_FSEL_Msk | CRPT_ECC_CTL_START_Msk;
685685
ecc_done = crypto_ecc_wait();
686686

687-
MBEDTLS_MPI_CHK(ecc_done ? 0 : MBEDTLS_ERR_SSL_HW_ACCEL_FAILED);
687+
MBEDTLS_MPI_CHK(ecc_done ? 0 : MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED);
688688

689689
/* (X1, Y1) hold the normalized result. */
690690
MBEDTLS_MPI_CHK(internal_mpi_read_eccreg(&R->X, (uint32_t *) CRPT->ECC_X1, NU_ECC_BIGNUM_MAXWORD));
@@ -792,7 +792,7 @@ NU_STATIC int internal_run_modop(mbedtls_mpi *r,
792792
CRPT->ECC_CTL = (pbits << CRPT_ECC_CTL_CURVEM_Pos) | (ECCOP_MODULE | modop) | CRPT_ECC_CTL_FSEL_Msk | CRPT_ECC_CTL_START_Msk;
793793
ecc_done = crypto_ecc_wait();
794794

795-
MBEDTLS_MPI_CHK(ecc_done ? 0 : MBEDTLS_ERR_SSL_HW_ACCEL_FAILED);
795+
MBEDTLS_MPI_CHK(ecc_done ? 0 : MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED);
796796

797797
/* X1 holds the result. */
798798
MBEDTLS_MPI_CHK(internal_mpi_read_eccreg(r, (uint32_t *) CRPT->ECC_X1, NU_ECC_BIGNUM_MAXWORD));

0 commit comments

Comments
 (0)