diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 16416b3d2..9c81e7083 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -7974,12 +7974,15 @@ int wc_ecc_import_private_key_ex(const byte* priv, word32 privSz, ret = mp_read_unsigned_bin(&key->k, priv, privSz); } #elif defined(WOLFSSL_SILABS_SE_ACCEL) + if (ret == MP_OKAY) + ret = mp_read_unsigned_bin(&key->k, priv, privSz); + if (ret == MP_OKAY) { if (pub) { - ret = silabs_ecc_import(key, privSz); + ret = silabs_ecc_import(key, key->dp->size); } else { - ret = silabs_ecc_import_private(key, privSz); + ret = silabs_ecc_import_private(key, key->dp->size); } } #else diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 5b9ee6132..055f7cd91 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -333,6 +333,9 @@ int wolfCrypt_Cleanup(void) #if defined(WOLFSSL_CRYPTOCELL) cc310_Free(); #endif + #ifdef WOLFSSL_SILABS_SE_ACCEL + ret = sl_se_deinit(); + #endif #if defined(WOLFSSL_RENESAS_TSIP_CRYPT) tsip_Close(); #endif diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 16455f72d..f36ce8af4 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -22337,20 +22337,19 @@ static int ecc_test_buffers(void) TEST_SLEEP(); XMEMSET(plain, 0, sizeof(plain)); - verify = 1; do { #if defined(WOLFSSL_ASYNC_CRYPT) ret = wc_AsyncWait(ret, cliKey.asyncDev, WC_ASYNC_FLAG_CALL_AGAIN); #endif if (ret == 0) - ret = wc_ecc_verify_hash(out, x, plain, inLen, &verify, + ret = wc_ecc_verify_hash(out, x, in, inLen, &verify, cliKey); } while (ret == WC_PENDING_E); if (ret < 0) ERROR_OUT(-10430, done); - if (verify != 0) + if (verify != 1) ERROR_OUT(-10431, done); TEST_SLEEP();