From 5cee9b9c6394cffee6f31fab00323d9e559f0702 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 11 Feb 2019 17:56:37 +0100 Subject: General improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libkeccak_hmac_fast_update.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libkeccak_hmac_fast_update.c') diff --git a/libkeccak_hmac_fast_update.c b/libkeccak_hmac_fast_update.c index fe49960..5a1eb70 100644 --- a/libkeccak_hmac_fast_update.c +++ b/libkeccak_hmac_fast_update.c @@ -14,8 +14,8 @@ int libkeccak_hmac_fast_update(struct libkeccak_hmac_state *restrict state, const void *restrict msg_, size_t msglen) { - const char *restrict msg = msg_; - char *old; + const unsigned char *restrict msg = msg_; + unsigned char *old; size_t i; int n, cn; @@ -43,9 +43,9 @@ libkeccak_hmac_fast_update(struct libkeccak_hmac_state *restrict state, const vo n = (int)(state->key_length & 7); cn = 8 - n; for (i = 1; i < msglen; i++) - state->buffer[i] = (char)((msg[i - 1] >> cn) | (msg[i] << n)); - state->buffer[0] = (char)((state->leftover & ((1 << n) - 1)) | (msg[0] << n)); - state->leftover = (char)((unsigned char)msg[msglen - 1] >> cn); + state->buffer[i] = (unsigned char)((msg[i - 1] >> cn) | (msg[i] << n)); + state->buffer[0] = (unsigned char)((state->leftover & ((1 << n) - 1)) | (msg[0] << n)); + state->leftover = (unsigned char)(msg[msglen - 1] >> cn); return libkeccak_fast_update(&state->sponge, state->buffer, msglen); } -- cgit v1.2.3-70-g09d2