aboutsummaryrefslogtreecommitdiffstats
path: root/hmac_state_output_size.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-02-10 20:21:19 +0100
committerMattias Andrée <maandree@kth.se>2019-02-10 20:21:19 +0100
commited0296b9055713df0d910e4e7528ffe6fc539514 (patch)
tree8cbf8ecc9b6352257d6bc4946ff75cb8a4b484c0 /hmac_state_output_size.c
downloadlibsha1-ed0296b9055713df0d910e4e7528ffe6fc539514.tar.gz
libsha1-ed0296b9055713df0d910e4e7528ffe6fc539514.tar.bz2
libsha1-ed0296b9055713df0d910e4e7528ffe6fc539514.tar.xz
First commit
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..68e5ed2
--- /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
+libsha1_hmac_state_output_size(const struct libsha1_hmac_state *restrict state)
+{
+ return libsha1_algorithm_output_size(state->sha1_state.algorithm);
+}