diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-24 21:25:13 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-25 03:01:21 +0200 |
commit | 3106f71185676be1b95a814e9015525dd17ab19c (patch) | |
tree | 7f33eaf8222fa232622118ed31b9b89feef771cf /src/crypto/zinc/chacha20/chacha20-arm-glue.h | |
parent | 53f59997f15cd60793d1ed15c62852928e79589a (diff) |
hchacha20: keep in native endian in words
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/zinc/chacha20/chacha20-arm-glue.h')
-rw-r--r-- | src/crypto/zinc/chacha20/chacha20-arm-glue.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/crypto/zinc/chacha20/chacha20-arm-glue.h b/src/crypto/zinc/chacha20/chacha20-arm-glue.h index 1f1add0..86cce85 100644 --- a/src/crypto/zinc/chacha20/chacha20-arm-glue.h +++ b/src/crypto/zinc/chacha20/chacha20-arm-glue.h @@ -57,8 +57,10 @@ static inline bool chacha20_arch(struct chacha20_ctx *state, u8 *dst, return true; } -static inline bool hchacha20_arch(u8 *derived_key, const u8 *nonce, - const u8 *key, simd_context_t *simd_context) +static inline bool hchacha20_arch(u32 derived_key[CHACHA20_KEY_WORDS], + const u8 nonce[HCHACHA20_NONCE_SIZE], + const u8 key[HCHACHA20_KEY_SIZE], + simd_context_t *simd_context) { #if defined(CONFIG_ARM) u32 x[] = { CHACHA20_CONSTANT_EXPA, @@ -78,7 +80,7 @@ static inline bool hchacha20_arch(u8 *derived_key, const u8 *nonce, get_unaligned_le32(nonce + 8), get_unaligned_le32(nonce + 12) }; - hchacha20_arm(x, (u32 *)derived_key); + hchacha20_arm(x, derived_key); return true; #else return false; |