From 6214b358a5502915d977d3f850d34bcad71c4cde Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 4 Sep 2018 10:44:42 -0600 Subject: global: prefer sizeof(*pointer) when possible Suggested-by: Sultan Alsawaf --- src/crypto/include/zinc/blake2s.h | 2 +- src/crypto/zinc/blake2s/blake2s.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/crypto') diff --git a/src/crypto/include/zinc/blake2s.h b/src/crypto/include/zinc/blake2s.h index 0e50836..5e32d57 100644 --- a/src/crypto/include/zinc/blake2s.h +++ b/src/crypto/include/zinc/blake2s.h @@ -65,7 +65,7 @@ static inline void blake2s_final(struct blake2s_state *state, u8 *out, memzero_explicit(buffer, sizeof(buffer)); } - memzero_explicit(state, sizeof(struct blake2s_state)); + memzero_explicit(state, sizeof(*state)); } static inline void blake2s(u8 *out, const u8 *in, const u8 *key, diff --git a/src/crypto/zinc/blake2s/blake2s.c b/src/crypto/zinc/blake2s/blake2s.c index 76232a3..13765d3 100644 --- a/src/crypto/zinc/blake2s/blake2s.c +++ b/src/crypto/zinc/blake2s/blake2s.c @@ -71,7 +71,7 @@ static inline void blake2s_init_param(struct blake2s_state *state, { int i; - memset(state, 0, sizeof(struct blake2s_state)); + memset(state, 0, sizeof(*state)); for (i = 0; i < 8; ++i) state->h[i] = blake2s_iv[i] ^ le32_to_cpu(param->words[i]); } -- cgit v1.2.3-59-g8ed1b