aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/geode-aes.c6
-rw-r--r--drivers/crypto/geode-aes.h2
2 files changed, 3 insertions, 5 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,
315 315
316 blkcipher_walk_init(&walk, dst, src, nbytes); 316 blkcipher_walk_init(&walk, dst, src, nbytes);
317 err = blkcipher_walk_virt(desc, &walk); 317 err = blkcipher_walk_virt(desc, &walk);
318 memcpy(op->iv, walk.iv, AES_IV_LENGTH); 318 op->iv = walk.iv;
319 319
320 while((nbytes = walk.nbytes)) { 320 while((nbytes = walk.nbytes)) {
321 op->src = walk.src.virt.addr, 321 op->src = walk.src.virt.addr,
@@ -330,7 +330,6 @@ geode_cbc_decrypt(struct blkcipher_desc *desc,
330 err = blkcipher_walk_done(desc, &walk, nbytes); 330 err = blkcipher_walk_done(desc, &walk, nbytes);
331 } 331 }
332 332
333 memcpy(walk.iv, op->iv, AES_IV_LENGTH);
334 return err; 333 return err;
335} 334}
336 335
@@ -348,7 +347,7 @@ geode_cbc_encrypt(struct blkcipher_desc *desc,
348 347
349 blkcipher_walk_init(&walk, dst, src, nbytes); 348 blkcipher_walk_init(&walk, dst, src, nbytes);
350 err = blkcipher_walk_virt(desc, &walk); 349 err = blkcipher_walk_virt(desc, &walk);
351 memcpy(op->iv, walk.iv, AES_IV_LENGTH); 350 op->iv = walk.iv;
352 351
353 while((nbytes = walk.nbytes)) { 352 while((nbytes = walk.nbytes)) {
354 op->src = walk.src.virt.addr, 353 op->src = walk.src.virt.addr,
@@ -362,7 +361,6 @@ geode_cbc_encrypt(struct blkcipher_desc *desc,
362 err = blkcipher_walk_done(desc, &walk, nbytes); 361 err = blkcipher_walk_done(desc, &walk, nbytes);
363 } 362 }
364 363
365 memcpy(walk.iv, op->iv, AES_IV_LENGTH);
366 return err; 364 return err;
367} 365}
368 366
diff --git a/drivers/crypto/geode-aes.h b/drivers/crypto/geode-aes.h
index 14cc763da1e4..f1855b50da48 100644
--- a/drivers/crypto/geode-aes.h
+++ b/drivers/crypto/geode-aes.h
@@ -65,7 +65,7 @@ struct geode_aes_op {
65 int len; 65 int len;
66 66
67 u8 key[AES_KEY_LENGTH]; 67 u8 key[AES_KEY_LENGTH];
68 u8 iv[AES_IV_LENGTH]; 68 u8 *iv;
69 69
70 union { 70 union {
71 struct crypto_blkcipher *blk; 71 struct crypto_blkcipher *blk;