From 13bcaa274e0276bc5fe1e50008826352ffb5c87f Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 6 Sep 2024 21:46:35 -0400 Subject: Squashed commit of the following: commit d5235f583cc984bf0a36f01aac80ca21ee712e3a Author: vnugent Date: Fri Sep 6 21:44:09 2024 -0400 update changelog for v0.1.5 commit b4a5a50098eba9ef1633715a8a74c5ac0c32b2e2 Author: vnugent Date: Fri Sep 6 21:37:01 2024 -0400 configure autobuild for master branch commit de9741b417ee04a54512af106b71cf388c93ea9d Author: vnugent Date: Wed Aug 28 19:54:45 2024 -0400 feat: add library context alloc util functions --- src/noscryptutil.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/noscryptutil.c b/src/noscryptutil.c index 115ad04..333ef74 100644 --- a/src/noscryptutil.c +++ b/src/noscryptutil.c @@ -672,6 +672,19 @@ NC_EXPORT NCResult NC_CC NCUtilGetEncryptionBufferSize(uint32_t encVersion, uint } +NC_EXPORT NCContext* NC_CC NCUtilContextAlloc(void) +{ + /* Dynamically allocate context aligned and zeroed */ + return (NCContext*)_nc_mem_alloc(1, NCGetContextStructSize()); +} + + +NC_EXPORT void NC_CC NCUtilContextFree(NCContext* ctx) +{ + _nc_mem_free(ctx); +} + + NC_EXPORT NCUtilCipherContext* NC_CC NCUtilCipherAlloc(uint32_t encVersion, uint32_t flags) { NCUtilCipherContext* encCtx; -- cgit