summaryrefslogtreecommitdiff
path: root/crypto/pcbc.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2017-11-13 10:24:50 +0100
committerJuergen Gross <jgross@suse.com>2017-11-13 10:24:50 +0100
commit40248a5f572a9ee5602fb61b33ddcc7de3b4cf5b (patch)
treeb443b237fa80f2cc8ca8510b63aaa4861ba3ea7a /crypto/pcbc.c
parent4f673910a79f5cb0e7dd87bf807eebb24834cea3 (diff)
parent37d98457e3c414a1673bf5dce97eb4c79b5cff25 (diff)
downloadlinux-crypto-40248a5f572a9ee5602fb61b33ddcc7de3b4cf5b.tar.gz
linux-crypto-40248a5f572a9ee5602fb61b33ddcc7de3b4cf5b.zip
Merge tag 'v4.14' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Linux 4.14
Diffstat (limited to 'crypto/pcbc.c')
-rw-r--r--crypto/pcbc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/crypto/pcbc.c b/crypto/pcbc.c
index 29dd2b4a..d9e45a95 100644
--- a/crypto/pcbc.c
+++ b/crypto/pcbc.c
@@ -55,8 +55,7 @@ static int crypto_pcbc_encrypt_segment(struct skcipher_request *req,
do {
crypto_xor(iv, src, bsize);
crypto_cipher_encrypt_one(tfm, dst, iv);
- memcpy(iv, dst, bsize);
- crypto_xor(iv, src, bsize);
+ crypto_xor_cpy(iv, dst, src, bsize);
src += bsize;
dst += bsize;
@@ -79,8 +78,7 @@ static int crypto_pcbc_encrypt_inplace(struct skcipher_request *req,
memcpy(tmpbuf, src, bsize);
crypto_xor(iv, src, bsize);
crypto_cipher_encrypt_one(tfm, src, iv);
- memcpy(iv, tmpbuf, bsize);
- crypto_xor(iv, src, bsize);
+ crypto_xor_cpy(iv, tmpbuf, src, bsize);
src += bsize;
} while ((nbytes -= bsize) >= bsize);
@@ -127,8 +125,7 @@ static int crypto_pcbc_decrypt_segment(struct skcipher_request *req,
do {
crypto_cipher_decrypt_one(tfm, dst, src);
crypto_xor(dst, iv, bsize);
- memcpy(iv, src, bsize);
- crypto_xor(iv, dst, bsize);
+ crypto_xor_cpy(iv, dst, src, bsize);
src += bsize;
dst += bsize;
@@ -153,8 +150,7 @@ static int crypto_pcbc_decrypt_inplace(struct skcipher_request *req,
memcpy(tmpbuf, src, bsize);
crypto_cipher_decrypt_one(tfm, src, src);
crypto_xor(src, iv, bsize);
- memcpy(iv, tmpbuf, bsize);
- crypto_xor(iv, src, bsize);
+ crypto_xor_cpy(iv, src, tmpbuf, bsize);
src += bsize;
} while ((nbytes -= bsize) >= bsize);