summaryrefslogtreecommitdiffhomepage
path: root/src/crypto/zinc/chacha20/chacha20.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-17 05:49:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-17 06:03:01 +0200
commitb5d6181c6f56aaaee4da1a747e84a54b769df0a6 (patch)
tree0bfc4c506d50439a8f76f3c9f2e395d05b085dde /src/crypto/zinc/chacha20/chacha20.c
parent399d5bb850b0e0d0269ef14bb52720221cb526a4 (diff)
crypto: pass simd by reference
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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/crypto/zinc/chacha20/chacha20.c b/src/crypto/zinc/chacha20/chacha20.c
index fdfccdc..da04d5b 100644
--- a/src/crypto/zinc/chacha20/chacha20.c
+++ b/src/crypto/zinc/chacha20/chacha20.c
@@ -18,12 +18,12 @@ void __init chacha20_fpu_init(void)
}
static inline bool chacha20_arch(u8 *out, const u8 *in, const size_t len,
const u32 key[8], const u32 counter[4],
- simd_context_t simd_context)
+ simd_context_t *simd_context)
{
return false;
}
static inline bool hchacha20_arch(u8 *derived_key, const u8 *nonce,
- const u8 *key, simd_context_t simd_context)
+ const u8 *key, simd_context_t *simd_context)
{
return false;
}
@@ -113,7 +113,7 @@ static void chacha20_generic(u8 *out, const u8 *in, u32 len, const u32 key[8],
}
void chacha20(struct chacha20_ctx *state, u8 *dst, const u8 *src, u32 len,
- simd_context_t simd_context)
+ simd_context_t *simd_context)
{
if (!chacha20_arch(dst, src, len, state->key, state->counter,
simd_context))
@@ -157,7 +157,7 @@ static void hchacha20_generic(u8 derived_key[CHACHA20_KEY_SIZE],
/* Derived key should be 32-bit aligned */
void hchacha20(u8 derived_key[CHACHA20_KEY_SIZE],
const u8 nonce[HCHACHA20_NONCE_SIZE],
- const u8 key[HCHACHA20_KEY_SIZE], simd_context_t simd_context)
+ const u8 key[HCHACHA20_KEY_SIZE], simd_context_t *simd_context)
{
if (!hchacha20_arch(derived_key, nonce, key, simd_context))
hchacha20_generic(derived_key, nonce, key);