ascon: fix api naming Deinit -> Clear

This commit is contained in:
Juliusz Sosinowicz
2025-01-29 11:07:40 +01:00
parent c5ad780798
commit ddcc189094
5 changed files with 16 additions and 16 deletions

View File

@ -166,13 +166,13 @@ int wc_AsconAEAD128_Init(wc_AsconAEAD128* a);
if (wc_AsconAEAD128_Init(&a) != 0)
// handle error
wc_AsconAEAD128_Deinit(&a);
wc_AsconAEAD128_Clear(&a);
\endcode
\sa wc_AsconAeadEncrypt
\sa wc_AsconAeadDecrypt
*/
void wc_AsconAEAD128_Deinit(wc_AsconAEAD128 *a);
void wc_AsconAEAD128_Clear(wc_AsconAEAD128 *a);
/*!
\ingroup ASCON
@ -307,7 +307,7 @@ int wc_AsconAEAD128_SetAD(wc_AsconAEAD128* a, const byte* ad, word32 adSz);
\endcode
\sa wc_AsconAeadInit
\sa wc_AsconAEAD128_Deinit
\sa wc_AsconAEAD128_Clear
\sa wc_AsconAEAD128_SetKey
\sa wc_AsconAEAD128_SetNonce
\sa wc_AsconAEAD128_SetAD

View File

@ -6157,7 +6157,7 @@ void bench_ascon_aead(void)
}
if (ret == 0)
ret = wc_AsconAEAD128_EncryptFinal(enc, authTag);
wc_AsconAEAD128_Deinit(enc);
wc_AsconAEAD128_Clear(enc);
if (ret != 0) {
printf("ASCON-AEAD error: %d\n", ret);

View File

@ -191,7 +191,7 @@ wc_AsconHash256* wc_AsconHash256_New(void)
void wc_AsconHash256_Free(wc_AsconHash256* a)
{
if (a != NULL) {
wc_AsconHash256_Deinit(a);
wc_AsconHash256_Clear(a);
XFREE(a, NULL, DYNAMIC_TYPE_ASCON);
}
}
@ -209,7 +209,7 @@ int wc_AsconHash256_Init(wc_AsconHash256* a)
return 0;
}
void wc_AsconHash256_Deinit(wc_AsconHash256* a)
void wc_AsconHash256_Clear(wc_AsconHash256* a)
{
if (a != NULL) {
ForceZero(a, sizeof(*a));
@ -271,7 +271,7 @@ int wc_AsconHash256_Final(wc_AsconHash256* a, byte* hash)
}
/* Clear state as soon as possible */
wc_AsconHash256_Deinit(a);
wc_AsconHash256_Clear(a);
return 0;
}
@ -293,7 +293,7 @@ wc_AsconAEAD128* wc_AsconAEAD128_New(void)
void wc_AsconAEAD128_Free(wc_AsconAEAD128 *a)
{
if (a != NULL) {
wc_AsconAEAD128_Deinit(a);
wc_AsconAEAD128_Clear(a);
XFREE(a, NULL, DYNAMIC_TYPE_ASCON);
}
}
@ -309,7 +309,7 @@ int wc_AsconAEAD128_Init(wc_AsconAEAD128 *a)
return 0;
}
void wc_AsconAEAD128_Deinit(wc_AsconAEAD128 *a)
void wc_AsconAEAD128_Clear(wc_AsconAEAD128 *a)
{
if (a != NULL) {
ForceZero(a, sizeof(*a));
@ -443,7 +443,7 @@ int wc_AsconAEAD128_EncryptFinal(wc_AsconAEAD128* a, byte* tag)
XMEMCPY(tag, &a->state.s64[3], ASCON_AEAD128_TAG_SZ);
/* Clear state as soon as possible */
wc_AsconAEAD128_Deinit(a);
wc_AsconAEAD128_Clear(a);
return 0;
@ -520,7 +520,7 @@ int wc_AsconAEAD128_DecryptFinal(wc_AsconAEAD128* a, const byte* tag)
return ASCON_AUTH_E;
/* Clear state as soon as possible */
wc_AsconAEAD128_Deinit(a);
wc_AsconAEAD128_Clear(a);
return 0;
}

View File

@ -8838,7 +8838,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ascon_hash256_test(void)
return WC_TEST_RET_ENC_EC(err);
if (XMEMCMP(mdOut, ascon_hash256_output[i], ASCON_HASH256_SZ) != 0)
return WC_TEST_RET_ENC_NC;
wc_AsconHash256_Deinit(&asconHash);
wc_AsconHash256_Clear(&asconHash);
}
/* Test separated update */
@ -8859,7 +8859,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ascon_hash256_test(void)
return WC_TEST_RET_ENC_EC(err);
if (XMEMCMP(mdOut, ascon_hash256_output[i], ASCON_HASH256_SZ) != 0)
return WC_TEST_RET_ENC_NC;
wc_AsconHash256_Deinit(&asconHash);
wc_AsconHash256_Clear(&asconHash);
}
return 0;
@ -9007,7 +9007,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t ascon_aead128_test(void)
}
wc_AsconAEAD128_Deinit(&asconAEAD);
wc_AsconAEAD128_Clear(&asconAEAD);
}
}

View File

@ -78,7 +78,7 @@ typedef struct wc_AsconAEAD128 {
WOLFSSL_API wc_AsconHash256* wc_AsconHash256_New(void);
WOLFSSL_API void wc_AsconHash256_Free(wc_AsconHash256* a);
WOLFSSL_API int wc_AsconHash256_Init(wc_AsconHash256* a);
WOLFSSL_API void wc_AsconHash256_Deinit(wc_AsconHash256* a);
WOLFSSL_API void wc_AsconHash256_Clear(wc_AsconHash256* a);
WOLFSSL_API int wc_AsconHash256_Update(wc_AsconHash256* a, const byte* data,
word32 dataSz);
WOLFSSL_API int wc_AsconHash256_Final(wc_AsconHash256* a, byte* hash);
@ -86,7 +86,7 @@ WOLFSSL_API int wc_AsconHash256_Final(wc_AsconHash256* a, byte* hash);
WOLFSSL_API wc_AsconAEAD128* wc_AsconAEAD128_New(void);
WOLFSSL_API void wc_AsconAEAD128_Free(wc_AsconAEAD128* a);
WOLFSSL_API int wc_AsconAEAD128_Init(wc_AsconAEAD128* a);
WOLFSSL_API void wc_AsconAEAD128_Deinit(wc_AsconAEAD128* a);
WOLFSSL_API void wc_AsconAEAD128_Clear(wc_AsconAEAD128* a);
/* AsconAEAD API */