forked from wolfSSL/wolfssl
SiLabs: add cleanup and address PR comments
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user