summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-17 23:23:58 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-18 04:21:16 +0200
commit8cc2a9abf92650af80d2343473a1142665a857dc (patch)
tree616e18b14db4f358782fec6e1fb10765f4f89b07
parent023db2863e36fe648b62e21c30fda0f38765323b (diff)
chacha20poly1305: relax simd between sg chunks
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/crypto/zinc/chacha20poly1305.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto/zinc/chacha20poly1305.c b/src/crypto/zinc/chacha20poly1305.c
index d5ebade..e1d17f8 100644
--- a/src/crypto/zinc/chacha20poly1305.c
+++ b/src/crypto/zinc/chacha20poly1305.c
@@ -122,6 +122,7 @@ bool chacha20poly1305_encrypt_sg(struct scatterlist *dst,
walk.src.virt.addr, chunk_len, simd_context);
poly1305_update(&poly1305_state, walk.dst.virt.addr,
chunk_len, simd_context);
+ simd_relax(simd_context);
ret = blkcipher_walk_done(&chacha20_desc, &walk,
walk.nbytes % CHACHA20_BLOCK_SIZE);
}
@@ -264,6 +265,7 @@ bool chacha20poly1305_decrypt_sg(struct scatterlist *dst,
chunk_len, simd_context);
chacha20(&chacha20_state, walk.dst.virt.addr,
walk.src.virt.addr, chunk_len, simd_context);
+ simd_relax(simd_context);
ret = blkcipher_walk_done(&chacha20_desc, &walk,
walk.nbytes % CHACHA20_BLOCK_SIZE);
}