diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-20 19:28:45 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-21 16:05:22 +0200 |
commit | da44b52039c58f73ae25b45598105ca7ef3fe275 (patch) | |
tree | f9be7d812d1fe0387f5a0df524cb2d25765e15b8 /src/crypto/zinc/chacha20/chacha20-mips-glue.h | |
parent | f61fb1b86c28225353ee67802b512c8529d21fb0 (diff) |
chacha20-mips32r2: use simpler calling convention
Since we now set up the block in the generic code, we can rely on that
to use fewer variables and reduce stack pressure within the MIPS code.
This in turn means we have more registers and more uniformity, so we're
able to rewrite quite a bit.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/zinc/chacha20/chacha20-mips-glue.h')
-rw-r--r-- | src/crypto/zinc/chacha20/chacha20-mips-glue.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/crypto/zinc/chacha20/chacha20-mips-glue.h b/src/crypto/zinc/chacha20/chacha20-mips-glue.h index e38098e..929ca12 100644 --- a/src/crypto/zinc/chacha20/chacha20-mips-glue.h +++ b/src/crypto/zinc/chacha20/chacha20-mips-glue.h @@ -3,8 +3,8 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -asmlinkage void chacha20_mips(u8 *out, const u8 *in, const size_t len, - const u32 key[8], const u32 counter[4]); +asmlinkage void chacha20_mips(u32 state[16], u8 *out, const u8 *in, + const size_t len); static void __init chacha20_fpu_init(void) { } @@ -13,8 +13,7 @@ static inline bool chacha20_arch(struct chacha20_ctx *state, u8 *dst, const u8 *src, const size_t len, simd_context_t *simd_context) { - chacha20_mips(dst, src, len, state->key, state->counter); - state->counter[0] += (len + 63) / 64; + chacha20_mips((u32 *)state, dst, src, len); return true; } |