summaryrefslogtreecommitdiffhomepage
path: root/src/crypto/zinc/chacha20/chacha20.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-11 21:02:29 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-12 16:17:47 +0200
commit13f9a92bc25c2b27fe4ff1057b08ddad2987d0b4 (patch)
treece506c4003491c8d95b798bcbd56ff0eec7ad7cc /src/crypto/zinc/chacha20/chacha20.c
parent95e8261773b8598ac448f49ad308a37677d69057 (diff)
chacha20: add constant for words in block
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/zinc/chacha20/chacha20.c')
-rw-r--r--src/crypto/zinc/chacha20/chacha20.c4
1 files changed, 2 insertions, 2 deletions
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],