summaryrefslogtreecommitdiff
path: root/crypto/pcbc.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-10-12 16:35:36 +0200
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-10-12 16:35:36 +0200
commit1ca96e9695b6c448befcd0abacaf473458f22d1c (patch)
tree9ba289bdd8831b061743a8d48b13e6128306b8f1 /crypto/pcbc.c
parentaa0bfc9cee13677f110cfb870f7b5d9cd60cf5a7 (diff)
parent508f8d23a372beae647185ce896a0c1109406b83 (diff)
downloadlinux-crypto-1ca96e9695b6c448befcd0abacaf473458f22d1c.tar.gz
linux-crypto-1ca96e9695b6c448befcd0abacaf473458f22d1c.zip
Merge tag 'v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next
Linux 4.14-rc4
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);