aboutsummaryrefslogtreecommitdiff
path: root/drivers/crypto/geode-aes.c
diff options
context:
space:
mode:
authorSebastian Siewior <sebastian@breakpoint.cc>2007-11-30 16:36:57 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2008-01-11 08:16:26 +1100
commitd2456c66236c15d6462f1ac751cdbd48a34e9704 (patch)
tree0d221b08d0c1d4942881ad138c142c4163d19717 /drivers/crypto/geode-aes.c
parent9617d6ef6278edd04070ae404c871f65a466c6d2 (diff)
downloadlinux-linaro-stable-d2456c66236c15d6462f1ac751cdbd48a34e9704.tar.gz
[CRYPTO] geode: do not copy the IV too often
There is no reason to keep the IV in the private structre. Instead keep just a pointer to make the patch smaller :) This also remove a few memcpy()s Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/geode-aes.c')
-rw-r--r--drivers/crypto/geode-aes.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 0ca92d414667..68be7d08aeb3 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -315,7 +315,7 @@ geode_cbc_decrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
- memcpy(op->iv, walk.iv, AES_IV_LENGTH);
+ op->iv = walk.iv;
while((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
@@ -330,7 +330,6 @@ geode_cbc_decrypt(struct blkcipher_desc *desc,
err = blkcipher_walk_done(desc, &walk, nbytes);
}
- memcpy(walk.iv, op->iv, AES_IV_LENGTH);
return err;
}
@@ -348,7 +347,7 @@ geode_cbc_encrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
- memcpy(op->iv, walk.iv, AES_IV_LENGTH);
+ op->iv = walk.iv;
while((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
@@ -362,7 +361,6 @@ geode_cbc_encrypt(struct blkcipher_desc *desc,
err = blkcipher_walk_done(desc, &walk, nbytes);
}
- memcpy(walk.iv, op->iv, AES_IV_LENGTH);
return err;
}