From 238d8b72069b80522066ac5edc3a4d2155e3382c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 13 Feb 2022 23:22:53 +0100 Subject: Add libar2_hash_buf_size and fix related documentation for libar2_hash --- libar2_hash_buf_size.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 libar2_hash_buf_size.c (limited to 'libar2_hash_buf_size.c') 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; +} -- cgit v1.2.3-70-g09d2