Skip to content

Commit 56a96ba

Browse files
committed
Allow compiling aes.c with WOLFSSL_NO_MALLOC
1 parent 43574e2 commit 56a96ba

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

wolfcrypt/src/aes.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11299,6 +11299,7 @@ int wc_AesCcmEncrypt_ex(Aes* aes, byte* out, const byte* in, word32 sz,
1129911299

1130011300
#endif /* HAVE_AESCCM */
1130111301

11302+
#ifndef WOLFSSL_NO_MALLOC
1130211303
Aes* wc_AesNew(void* heap, int devId)
1130311304
{
1130411305
Aes* aes = (Aes*)XMALLOC(sizeof(Aes), heap, DYNAMIC_TYPE_AES);
@@ -11313,6 +11314,7 @@ Aes* wc_AesNew(void* heap, int devId)
1131311314
}
1131411315
return aes;
1131511316
}
11317+
#endif
1131611318

1131711319
/* Initialize Aes for use with async hardware */
1131811320
int wc_AesInit(Aes* aes, void* heap, int devId)
@@ -11525,9 +11527,11 @@ void wc_AesFree(Aes* aes)
1152511527
wc_MemZero_Check(aes, sizeof(Aes));
1152611528
#endif
1152711529

11530+
#ifndef WOLFSSL_NO_MALLOC
1152811531
if (isAllocated) {
1152911532
XFREE(aes, heap, DYNAMIC_TYPE_AES);
1153011533
}
11534+
#endif
1153111535

1153211536
}
1153311537

0 commit comments

Comments
 (0)