aboutsummaryrefslogtreecommitdiffstats
path: root/hmac_state_output_size.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-10 17:54:09 +0100
committerMattias Andrée <maandree@kth.se>2019-02-10 17:54:09 +0100
commit6e3af681aa5927d2ab2861e94c0cfea6fa42c0ab (patch)
treedc14cf6beeab03da867e7946bd6ab3601a66d370 /hmac_state_output_size.c
parentlibsha2.h.0: securely erasing the state (diff)
downloadlibsha2-6e3af681aa5927d2ab2861e94c0cfea6fa42c0ab.tar.gz
libsha2-6e3af681aa5927d2ab2861e94c0cfea6fa42c0ab.tar.bz2
libsha2-6e3af681aa5927d2ab2861e94c0cfea6fa42c0ab.tar.xz
Minor improvement and man pages for HMAC
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'hmac_state_output_size.c')
-rw-r--r--hmac_state_output_size.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hmac_state_output_size.c b/hmac_state_output_size.c
new file mode 100644
index 0000000..d1a94dd
--- /dev/null
+++ b/hmac_state_output_size.c
@@ -0,0 +1,15 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+/**
+ * Get the output size of the algorithm specified for a HMAC state
+ *
+ * @param state The state
+ * @return The number of bytes in the output, zero on error
+ */
+size_t
+libsha2_hmac_state_output_size(const struct libsha2_hmac_state *restrict state)
+{
+ return libsha2_algorithm_output_size(state->sha2_state.algorithm);
+}