@@ -2315,6 +2315,12 @@ int wc_AesCtrSetKey(Aes* aes, const byte* key, word32 len, const byte* iv,
23152315 update parameter. It allows for key updates in certain hardware
23162316 implementations.
23172317
2318+ \note This function is currently only available when building with
2319+ Xilinx hardware acceleration. It requires one of the following build
2320+ options: WOLFSSL_XILINX_CRYPT (for Xilinx SecureIP integration) or
2321+ WOLFSSL_AFALG_XILINX_AES (for Xilinx AF_ALG support). This API may
2322+ be exposed for additional build configurations in the future.
2323+
23182324 \return 0 On success.
23192325 \return BAD_FUNC_ARG If aes or key is NULL, or if key length is invalid.
23202326
@@ -2460,8 +2466,15 @@ int wc_AesGcmEncryptInit_ex(Aes* aes, const byte* key, word32 len,
24602466 It processes plaintext and/or additional authentication data (AAD)
24612467 in a streaming fashion.
24622468
2469+ All the AAD must be passed to update before the plaintext.
2470+ The last part of AAD can be passed with the first part of plaintext.
2471+
2472+ Must set key and IV before calling this function.
2473+ Must call wc_AesGcmInit() before calling this function.
2474+
24632475 \return 0 On success.
2464- \return BAD_FUNC_ARG If aes is NULL, or if parameters are invalid.
2476+ \return BAD_FUNC_ARG If aes is NULL, or a length is non-zero but
2477+ buffer is NULL.
24652478
24662479 \param aes pointer to the AES structure
24672480 \param out pointer to buffer to store ciphertext (can be NULL if sz=0)
@@ -2480,7 +2493,7 @@ int wc_AesGcmEncryptInit_ex(Aes* aes, const byte* key, word32 len,
24802493 byte aad[20] = { }; // additional data
24812494
24822495 wc_AesInit(&aes, NULL, INVALID_DEVID);
2483- wc_AesGcmEncryptInit (&aes, key, 16, iv, 12);
2496+ wc_AesGcmInit (&aes, key, 16, iv, 12);
24842497 int ret = wc_AesGcmEncryptUpdate(&aes, ciphertext, plaintext, 100,
24852498 aad, 20);
24862499 if (ret != 0) {
@@ -2489,6 +2502,7 @@ int wc_AesGcmEncryptInit_ex(Aes* aes, const byte* key, word32 len,
24892502 wc_AesFree(&aes);
24902503 \endcode
24912504
2505+ \sa wc_AesGcmInit
24922506 \sa wc_AesGcmEncryptInit
24932507 \sa wc_AesGcmEncryptFinal
24942508*/
@@ -2575,8 +2589,15 @@ int wc_AesGcmDecryptInit(Aes* aes, const byte* key, word32 len,
25752589 It processes ciphertext and/or additional authentication data (AAD)
25762590 in a streaming fashion.
25772591
2592+ All the AAD must be passed to update before the ciphertext.
2593+ The last part of AAD can be passed with the first part of ciphertext.
2594+
2595+ Must set key and IV before calling this function.
2596+ Must call wc_AesGcmInit() before calling this function.
2597+
25782598 \return 0 On success.
2579- \return BAD_FUNC_ARG If aes is NULL, or if parameters are invalid.
2599+ \return BAD_FUNC_ARG If aes is NULL, or a length is non-zero but
2600+ buffer is NULL.
25802601
25812602 \param aes pointer to the AES structure
25822603 \param out pointer to buffer to store plaintext (can be NULL if sz=0)
@@ -2595,7 +2616,7 @@ int wc_AesGcmDecryptInit(Aes* aes, const byte* key, word32 len,
25952616 byte aad[20] = { }; // additional data
25962617
25972618 wc_AesInit(&aes, NULL, INVALID_DEVID);
2598- wc_AesGcmDecryptInit (&aes, key, 16, iv, 12);
2619+ wc_AesGcmInit (&aes, key, 16, iv, 12);
25992620 int ret = wc_AesGcmDecryptUpdate(&aes, plaintext, ciphertext, 100,
26002621 aad, 20);
26012622 if (ret != 0) {
@@ -2604,6 +2625,7 @@ int wc_AesGcmDecryptInit(Aes* aes, const byte* key, word32 len,
26042625 wc_AesFree(&aes);
26052626 \endcode
26062627
2628+ \sa wc_AesGcmInit
26072629 \sa wc_AesGcmDecryptInit
26082630 \sa wc_AesGcmDecryptFinal
26092631*/
0 commit comments