diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-25 17:56:08 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-31 17:25:23 +0100 |
commit | e09ec4dc2af38fb44add2fac518a726ae605b400 (patch) | |
tree | 950512f15664d121e92677ec1c35a5b1b1b870dc /src/crypto/blake2s.h | |
parent | qemu: work around ccache bugs (diff) | |
download | wireguard-monolithic-historical-e09ec4dc2af38fb44add2fac518a726ae605b400.tar.xz wireguard-monolithic-historical-e09ec4dc2af38fb44add2fac518a726ae605b400.zip |
global: style nits
Diffstat (limited to '')
-rw-r--r-- | src/crypto/blake2s.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crypto/blake2s.h b/src/crypto/blake2s.h index 99de9f9..9ed53ea 100644 --- a/src/crypto/blake2s.h +++ b/src/crypto/blake2s.h @@ -38,10 +38,12 @@ static inline void blake2s_final(struct blake2s_state *state, u8 *out, size_t ou if (__builtin_constant_p(outlen) && !(outlen % sizeof(u32))) { if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) || IS_ALIGNED((unsigned long)out, __alignof__(u32))) { __le32 *outwords = (__le32 *)out; + for (i = 0; i < outlen / sizeof(u32); ++i) outwords[i] = cpu_to_le32(state->h[i]); } else { __le32 buffer[BLAKE2S_OUTBYTES]; + for (i = 0; i < outlen / sizeof(u32); ++i) buffer[i] = cpu_to_le32(state->h[i]); memcpy(out, buffer, outlen); @@ -50,6 +52,7 @@ static inline void blake2s_final(struct blake2s_state *state, u8 *out, size_t ou } else { u8 buffer[BLAKE2S_OUTBYTES] __aligned(__alignof__(u32)); __le32 *outwords = (__le32 *)buffer; + for (i = 0; i < 8; ++i) outwords[i] = cpu_to_le32(state->h[i]); memcpy(out, buffer, outlen); |