aboutsummaryrefslogtreecommitdiff
path: root/include/noscryptutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/noscryptutil.h')
-rw-r--r--include/noscryptutil.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/noscryptutil.h b/include/noscryptutil.h
index bd60c79..63e08f8 100644
--- a/include/noscryptutil.h
+++ b/include/noscryptutil.h
@@ -43,6 +43,8 @@ extern "C" {
#define E_CIPHER_BAD_INPUT -15
#define E_CIPHER_BAD_INPUT_SIZE -16
+#define NC_UTIL_CIPHER_MODE 0x01u
+
#define NC_UTIL_CIPHER_MODE_ENCRYPT 0x00u
#define NC_UTIL_CIPHER_MODE_DECRYPT 0x01u
#define NC_UTIL_CIPHER_ZERO_ON_FREE 0x02u
@@ -132,7 +134,7 @@ NC_EXPORT NCResult NC_CC NCUtilCipherReadOutput(
);
/*
-* Sets a property on the encryption context. Equivalent to calling NCSetEncryptionPropertyEx
+* Sets a property on the encryption context. Equivalent to calling NCEncryptionSetPropertyEx
* @param ctx A valid pointer to an encryption context
* @param property The property to set
* @param value A pointer to the value to set
@@ -176,6 +178,15 @@ NC_EXPORT NCResult NC_CC NCUtilCipherUpdate(
const NCPublicKey* pk
);
+/*
+* Gets the size of the IV(nonce) required for the encryption context.
+* @param encCtx A valid pointer to an initialized encryption context
+* @return The size of the IV in bytes, or a negative error code if the context
+* is invalid, or the version is not supported. Use NCParseErrorCode to get the error code
+* and positional argument that caused the error.
+*/
+NC_EXPORT NCResult NC_CC NCUtilCipherGetIvSize(const NCUtilCipherContext* encCtx);
+
#ifdef __cplusplus
}
#endif