From 7c8f910e5be9a1d86af5bdcb7e51e8092cc06cf6 Mon Sep 17 00:00:00 2001 From: vnugent Date: Wed, 7 Aug 2024 15:11:19 -0400 Subject: feat: added NCEncryptionGetIvSize() function and helpers --- include/noscryptutil.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include/noscryptutil.h') diff --git a/include/noscryptutil.h b/include/noscryptutil.h index bd60c79..709f607 100644 --- a/include/noscryptutil.h +++ b/include/noscryptutil.h @@ -132,7 +132,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 +176,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 -- cgit