aboutsummaryrefslogtreecommitdiffstats
path: root/libar2_hash_buf_size.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libar2_hash_buf_size.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libar2_hash_buf_size.c b/libar2_hash_buf_size.c
new file mode 100644
index 0000000..b165d4b
--- /dev/null
+++ b/libar2_hash_buf_size.c
@@ -0,0 +1,9 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+size_t
+libar2_hash_buf_size(struct libar2_argon2_parameters *params)
+{
+ return (params->hashlen > 64 && (params->hashlen & 127)) ? (params->hashlen | 127) + 1 : params->hashlen;
+}