summaryrefslogtreecommitdiffhomepage
path: root/src/crypto/blake2s.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-25 17:56:08 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-31 17:25:23 +0100
commitabddb8492c55482048b10788e00ec20e5ee3948f (patch)
treec120c38e63eccdea9cac4bd16d03b6d4919a6b9d /src/crypto/blake2s.h
parentce7e110ef3a0809e875b7c8a0008226ecda32518 (diff)
global: style nits
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/blake2s.h')
-rw-r--r--src/crypto/blake2s.h3
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);