summaryrefslogtreecommitdiff
path: root/crypto/pcbc.c
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2017-09-25 11:15:38 -0400
committerDoug Ledford <dledford@redhat.com>2017-09-25 11:16:58 -0400
commite83c465ae14844b2dfff55178b82eeaccbef0b24 (patch)
tree9ba289bdd8831b061743a8d48b13e6128306b8f1 /crypto/pcbc.c
parentf960b5ebd9ed09bc12e10c712bce82ab58ef0435 (diff)
parent508f8d23a372beae647185ce896a0c1109406b83 (diff)
downloadlinux-crypto-e83c465ae14844b2dfff55178b82eeaccbef0b24.tar.gz
linux-crypto-e83c465ae14844b2dfff55178b82eeaccbef0b24.zip
Merge tag 'v4.14-rc2' into k.o/for-next
Merge my for-next branch to Linux 4.14-rc2 and open up the for-next area for 4.15 kernel development. Signed-off-by: Doug Ledford <dledford@redhat.com>
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);