Browse Source

Merge pull request #5600 from embhorn/zd14858

Add reference to wc_AesInit in Gmac API doc
David Garske 1 year ago
parent
commit
d42f8e0834
1 changed files with 4 additions and 0 deletions
  1. 4 0
      doc/dox_comments/header_files/aes.h

+ 4 - 0
doc/dox_comments/header_files/aes.h

@@ -455,10 +455,12 @@ int  wc_AesGcmDecrypt(Aes* aes, byte* out,
     \code
     Gmac gmac;
     key[] = { some 16, 24, or 32 byte length key };
+    wc_AesInit(gmac.aes, HEAP_HINT, INVALID_DEVID); // Make sure devId updated
     wc_GmacSetKey(&gmac, key, sizeof(key));
     \endcode
 
     \sa wc_GmacUpdate
+    \sa wc_AesInit
 */
 int wc_GmacSetKey(Gmac* gmac, const byte* key, word32 len);
 
@@ -486,6 +488,7 @@ int wc_GmacSetKey(Gmac* gmac, const byte* key, word32 len);
     key[] = { some 16, 24, or 32 byte length key };
     iv[] = { some 16 byte length iv };
 
+    wc_AesInit(gmac.aes, HEAP_HINT, INVALID_DEVID); // Make sure devId updated
     wc_GmacSetKey(&gmac, key, sizeof(key));
     authIn[] = { some 16 byte authentication input };
     tag[AES_BLOCK_SIZE]; // will store authentication code
@@ -495,6 +498,7 @@ int wc_GmacSetKey(Gmac* gmac, const byte* key, word32 len);
     \endcode
 
     \sa wc_GmacSetKey
+    \sa wc_AesInit
 */
 int wc_GmacUpdate(Gmac* gmac, const byte* iv, word32 ivSz,
                                const byte* authIn, word32 authInSz,