diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-08-07 16:10:57 -0700 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-08-07 17:25:07 -0700 |
commit | 68550c35a4e0e365bb7d8d2c338bce6aa6294396 (patch) | |
tree | 872aa679eaaf8693a5f2dda6fc72abd888a7fbd3 | |
parent | 829b062cf5403089d3deefcff32e511e084ea978 (diff) |
chacha20: use memmove in case buffers overlap
Suggested-by: Samuel Neves <sneves@dei.uc.pt>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | src/crypto/chacha20.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crypto/chacha20.c b/src/crypto/chacha20.c index 29f7e6b..815d777 100644 --- a/src/crypto/chacha20.c +++ b/src/crypto/chacha20.c @@ -137,7 +137,7 @@ static void chacha20_generic(u8 *out, const u8 *in, u32 len, const u32 key[8], c }; if (out != in) - memcpy(out, in, len); + memmove(out, in, len); while (len >= CHACHA20_BLOCK_SIZE) { chacha20_block_generic(buf, x); |