@@ -102,6 +102,7 @@ def generate_libwolfssl():
102102ERROR_STRINGS_ENABLED = 1
103103ASN_ENABLED = 1
104104WC_RNG_SEED_CB_ENABLED = 0
105+ AESGCM_STREAM = 1
105106
106107# detect native features based on options.h defines
107108if featureDetection :
@@ -126,6 +127,7 @@ def generate_libwolfssl():
126127 ERROR_STRINGS_ENABLED = 0 if '#define NO_ERROR_STRINGS' in optionsHeaderStr else 1
127128 ASN_ENABLED = 0 if '#define NO_ASN' in optionsHeaderStr else 1
128129 WC_RNG_SEED_CB_ENABLED = 1 if '#define WC_RNG_SEED_CB' in optionsHeaderStr else 0
130+ AESGCM_STREAM = 1 if '#define WOLFSSL_AESGCM_STREAM' in optionsHeaderStr else 0
129131
130132 if '#define HAVE_FIPS' in optionsHeaderStr :
131133 FIPS_ENABLED = 1
@@ -202,6 +204,7 @@ def generate_libwolfssl():
202204 int FIPS_VERSION = """ + str (FIPS_VERSION ) + """;
203205 int ASN_ENABLED = """ + str (ASN_ENABLED ) + """;
204206 int WC_RNG_SEED_CB_ENABLED = """ + str (WC_RNG_SEED_CB_ENABLED ) + """;
207+ int AESGCM_STREAM = """ + str (AESGCM_STREAM ) + """;
205208 """ ,
206209 include_dirs = [wolfssl_inc_path ()],
207210 library_dirs = [wolfssl_lib_path ()],
@@ -231,6 +234,7 @@ def generate_libwolfssl():
231234 extern int FIPS_VERSION;
232235 extern int ASN_ENABLED;
233236 extern int WC_RNG_SEED_CB_ENABLED;
237+ extern int AESGCM_STREAM;
234238
235239 typedef unsigned char byte;
236240 typedef unsigned int word32;
@@ -322,6 +326,27 @@ def generate_libwolfssl():
322326 int wc_AesCbcDecrypt(Aes*, byte*, const byte*, word32);
323327 """
324328
329+ if AES_ENABLED and AESGCM_STREAM :
330+ _cdef += """
331+ int wc_AesInit(Aes* aes, void* heap, int devId);
332+ int wc_AesGcmInit(Aes* aes, const byte* key, word32 len,
333+ const byte* iv, word32 ivSz);
334+ int wc_AesGcmEncryptInit(Aes* aes, const byte* key, word32 len,
335+ const byte* iv, word32 ivSz);
336+ int wc_AesGcmEncryptInit_ex(Aes* aes, const byte* key, word32 len,
337+ byte* ivOut, word32 ivOutSz);
338+ int wc_AesGcmEncryptUpdate(Aes* aes, byte* out, const byte* in,
339+ word32 sz, const byte* authIn, word32 authInSz);
340+ int wc_AesGcmEncryptFinal(Aes* aes, byte* authTag,
341+ word32 authTagSz);
342+ int wc_AesGcmDecryptInit(Aes* aes, const byte* key, word32 len,
343+ const byte* iv, word32 ivSz);
344+ int wc_AesGcmDecryptUpdate(Aes* aes, byte* out, const byte* in,
345+ word32 sz, const byte* authIn, word32 authInSz);
346+ int wc_AesGcmDecryptFinal(Aes* aes, const byte* authTag,
347+ word32 authTagSz);
348+ """
349+
325350if CHACHA_ENABLED :
326351 _cdef += """
327352 typedef struct { ...; } ChaCha;
0 commit comments