Topic: AES Explanation

In the example of wc_aesGcmEncrypt found at https://www.wolfssl.com/documentation/m … gcmencrypt it does not use wc_AesGcmEncryptInit but for the file example it is used and required to complete the encryption. https://github.com/wolfSSL/wolfssl-exam … encrypt.c.

Do I need to always call the initializations?

Share

Re: AES Explanation

Hi , 

wc_AesGcmEncrypt() is what is known as a "one-shot" API; the whole AES algorithm is run in a single API call. 

The file encryption example does not use that API.  It uses wc_AesGcmEncryptInit(), wc_AesGcmEncryptUpdate(), and wc_AesGcmEncryptFinal(); this  is known as a streaming API which allows the data to be encrypted to be fed in as chunks.  This is useful if you are getting dtata in chunks and don't have the full content in a buffer before hand. 

Warm regards, Anthony

Share

Re: AES Explanation

Bryce, 

in future, please direct questions to support@wolfssl.com .

Warm regards, Anthony

Share