aboutsummaryrefslogtreecommitdiffstats
path: root/hmac_update.c
diff options
context:
space:
mode:
Diffstat (limited to 'hmac_update.c')
-rw-r--r--hmac_update.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/hmac_update.c b/hmac_update.c
index 7f4cef3..245c7b1 100644
--- a/hmac_update.c
+++ b/hmac_update.c
@@ -5,22 +5,19 @@
/**
* Feed data into the HMAC algorithm
*
- * @param state The state of the algorithm
- * @param data Data to feed into the algorithm
- * @param n The number of bytes to feed into the
- * algorithm, this must be a multiple of 8
- * @return Zero on success, -1 on error
+ * @param state The state of the algorithm
+ * @param data Data to feed into the algorithm
+ * @param n The number of bytes to feed into the
+ * algorithm, this must be a multiple of 8
*/
-int
+void
libsha2_hmac_update(struct libsha2_hmac_state *restrict state, const void *restrict data, size_t n)
{
if (!state->inited) {
- if (libsha2_init(&state->sha2_state, state->sha2_state.algorithm))
- return -1;
+ libsha2_init(&state->sha2_state, state->sha2_state.algorithm);
libsha2_update(&state->sha2_state, state->ipad, state->sha2_state.chunk_size * 8);
state->inited = 1;
}
libsha2_update(&state->sha2_state, data, n);
- return 0;
}