From b9ecf5b02fc59c8dce822fb6ad34f4f9a70b9ab3 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 11 Sep 2018 21:02:29 -0600 Subject: chacha20: add constant for words in block --- src/crypto/zinc/chacha20/chacha20.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/crypto/zinc/chacha20/chacha20.c') diff --git a/src/crypto/zinc/chacha20/chacha20.c b/src/crypto/zinc/chacha20/chacha20.c index ab5ef07..1d9168e 100644 --- a/src/crypto/zinc/chacha20/chacha20.c +++ b/src/crypto/zinc/chacha20/chacha20.c @@ -72,7 +72,7 @@ static inline bool hchacha20_arch(u8 *derived_key, const u8 *nonce, static void chacha20_block_generic(__le32 *stream, u32 *state) { - u32 x[CHACHA20_BLOCK_SIZE / sizeof(u32)]; + u32 x[CHACHA20_BLOCK_WORDS]; int i; for (i = 0; i < ARRAY_SIZE(x); ++i) @@ -89,7 +89,7 @@ static void chacha20_block_generic(__le32 *stream, u32 *state) static void chacha20_generic(u8 *out, const u8 *in, u32 len, const u32 key[8], const u32 counter[4]) { - __le32 buf[CHACHA20_BLOCK_SIZE / sizeof(__le32)]; + __le32 buf[CHACHA20_BLOCK_WORDS]; u32 x[] = { EXPAND_32_BYTE_K, key[0], key[1], key[2], key[3], -- cgit v1.2.3-59-g8ed1b