aboutsummaryrefslogtreecommitdiff
path: root/src/noscrypt.h
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-03-02 22:57:36 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-03-02 22:57:36 -0500
commit1b84e3c7c2e55b1ff9ffdd09b66873e11c131441 (patch)
tree6cc9fc8a9398d9374c38ff8d2d6dc6605cbd5005 /src/noscrypt.h
parent9de5a214c66adea0ef2d0bac63c59449de202a88 (diff)
fix: #2 constent usage of sizeof() operator on struct types
Diffstat (limited to 'src/noscrypt.h')
-rw-r--r--src/noscrypt.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/noscrypt.h b/src/noscrypt.h
index 983206c..677843f 100644
--- a/src/noscrypt.h
+++ b/src/noscrypt.h
@@ -193,11 +193,21 @@ typedef struct nc_mac_verify {
API FUNCTIONS
*/
+/*
+* A helper function to cast a 32byte buffer to a NCSecretKey struct
+* @param key The 32byte buffer to cast
+* @return A pointer to the NCSecretKey struct
+*/
static inline NCSecretKey* NCToSecKey(uint8_t key[NC_SEC_KEY_SIZE])
{
return (NCSecretKey*)key;
}
+/*
+* A helper function to cast a 32byte buffer to a NCPublicKey struct
+* @param key The 32byte buffer to cast
+* @return A pointer to the NCPublicKey struct
+*/
static inline NCPublicKey* NCToPubKey(uint8_t key[NC_PUBKEY_SIZE])
{
return (NCPublicKey*)key;