diff options
author | Mattias Andrée <maandree@kth.se> | 2021-07-30 18:06:26 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-07-30 18:06:26 +0200 |
commit | a198f806d60b641406955d6b8c494b2bd5d8989c (patch) | |
tree | 27883711145184fff8d9dc564d368383b1c675db /libkeccak.h | |
parent | Fix warning (diff) | |
download | libkeccak-a198f806d60b641406955d6b8c494b2bd5d8989c.tar.gz libkeccak-a198f806d60b641406955d6b8c494b2bd5d8989c.tar.bz2 libkeccak-a198f806d60b641406955d6b8c494b2bd5d8989c.tar.xz |
Do not divide by sizeof(char)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libkeccak.h')
-rw-r--r-- | libkeccak.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libkeccak.h b/libkeccak.h index 36c86f3..df712d8 100644 --- a/libkeccak.h +++ b/libkeccak.h @@ -808,7 +808,7 @@ struct libkeccak_hmac_state { */ unsigned char leftover; - char __pad[sizeof(void *) / sizeof(char) - 1]; + char __pad[sizeof(void *) - 1]; }; @@ -1008,11 +1008,11 @@ libkeccak_hmac_marshal(const struct libkeccak_hmac_state *restrict state, void * unsigned char *restrict data = data_; size_t written = libkeccak_state_marshal(&state->sponge, data); if (data) { - data += written / sizeof(char); + data += written; *(size_t *)data = state->key_length; - data += sizeof(size_t) / sizeof(char); + data += sizeof(size_t); memcpy(data, state->key_opad, (state->key_length + 7) >> 3); - data += ((state->key_length + 7) >> 3) / sizeof(char); + data += (state->key_length + 7) >> 3; data[0] = (unsigned char)!!state->key_ipad; data[1] = state->leftover; } |