Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75892
b: refs/heads/master
c: 2d506d4
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Siewior authored and Herbert Xu committed Jan 10, 2008
1 parent f62e115 commit 0c516d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 89e12654312dddbbdbf17b5adc95b22cb672f947
refs/heads/master: 2d506d4fa1df18aa9505820722f834426edc907f
10 changes: 4 additions & 6 deletions trunk/drivers/crypto/geode-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,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);

while((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
Expand All @@ -234,16 +235,13 @@ geode_cbc_decrypt(struct blkcipher_desc *desc,
op->len = nbytes - (nbytes % AES_MIN_BLOCK_SIZE);
op->dir = AES_DIR_DECRYPT;

memcpy(op->iv, walk.iv, AES_IV_LENGTH);

ret = geode_aes_crypt(op);

memcpy(walk.iv, op->iv, AES_IV_LENGTH);
nbytes -= ret;

err = blkcipher_walk_done(desc, &walk, nbytes);
}

memcpy(walk.iv, op->iv, AES_IV_LENGTH);
return err;
}

Expand All @@ -258,6 +256,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);

while((nbytes = walk.nbytes)) {
op->src = walk.src.virt.addr,
Expand All @@ -266,13 +265,12 @@ geode_cbc_encrypt(struct blkcipher_desc *desc,
op->len = nbytes - (nbytes % AES_MIN_BLOCK_SIZE);
op->dir = AES_DIR_ENCRYPT;

memcpy(op->iv, walk.iv, AES_IV_LENGTH);

ret = geode_aes_crypt(op);
nbytes -= ret;
err = blkcipher_walk_done(desc, &walk, nbytes);
}

memcpy(walk.iv, op->iv, AES_IV_LENGTH);
return err;
}

Expand Down

0 comments on commit 0c516d4

Please sign in to comment.