aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-09-06 21:46:35 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-09-06 21:46:35 -0400
commit13bcaa274e0276bc5fe1e50008826352ffb5c87f (patch)
tree2d48136fe10d670221b5667b63cae902fce0f35c /include
parentea15299006cc2486c44fea72381e0c9e555c0d75 (diff)
Squashed commit of the following:v0.1.5
commit d5235f583cc984bf0a36f01aac80ca21ee712e3a Author: vnugent <public@vaughnnugent.com> Date: Fri Sep 6 21:44:09 2024 -0400 update changelog for v0.1.5 commit b4a5a50098eba9ef1633715a8a74c5ac0c32b2e2 Author: vnugent <public@vaughnnugent.com> Date: Fri Sep 6 21:37:01 2024 -0400 configure autobuild for master branch commit de9741b417ee04a54512af106b71cf388c93ea9d Author: vnugent <public@vaughnnugent.com> Date: Wed Aug 28 19:54:45 2024 -0400 feat: add library context alloc util functions
Diffstat (limited to 'include')
-rw-r--r--include/noscrypt.h4
-rw-r--r--include/noscryptutil.h13
2 files changed, 15 insertions, 2 deletions
diff --git a/include/noscrypt.h b/include/noscrypt.h
index 3702555..8ba71b0 100644
--- a/include/noscrypt.h
+++ b/include/noscrypt.h
@@ -156,7 +156,7 @@ typedef int64_t NCResult;
/*
An secp256k1 secret key (aka private key buffer)
*/
-typedef struct secret_key_struct {
+typedef struct nc_secret_key_struct {
uint8_t key[NC_SEC_KEY_SIZE];
@@ -165,7 +165,7 @@ typedef struct secret_key_struct {
/*
An x-only secp256k1 public key
*/
-typedef struct xonly_pubkey_struct {
+typedef struct nc_xonly_pubkey_struct {
uint8_t key[NC_PUBKEY_SIZE];
diff --git a/include/noscryptutil.h b/include/noscryptutil.h
index 63e08f8..ea5dad0 100644
--- a/include/noscryptutil.h
+++ b/include/noscryptutil.h
@@ -78,6 +78,19 @@ NC_EXPORT NCResult NC_CC NCUtilGetEncryptionPaddedSize(uint32_t encVersion, uint
NC_EXPORT NCResult NC_CC NCUtilGetEncryptionBufferSize(uint32_t encVersion, uint32_t plaintextSize);
/*
+* Allocates a new library context structure dynamically on the heap and returns a pointer to
+* it. The library context must be freed with NCUtilContextFree when it is no longer needed.
+* @return A valid pointer to a new library context or NULL if the operation failed
+*/
+NC_EXPORT NCContext* NC_CC NCUtilContextAlloc(void);
+
+/*
+* Frees the library context structure and clears the memory it points to.
+* @param ctx A valid pointer to a library context memory
+*/
+NC_EXPORT void NC_CC NCUtilContextFree(NCContext* ctx);
+
+/*
* Allocates a new encryption context and sets the encryption version and flags. The encryption context
* must be freed with NCUtilCipherFree when it is no longer needed.
* @param encVersion The encryption specification version to use