Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH 0/2] Fixes for parallel XTS/LRW patch series
@ 2011-10-23 15:23 Jussi Kivilinna
  2011-10-23 15:23 ` [PATCH 1/2] crypto: xts: fix nblocks not being updated in walk loop Jussi Kivilinna
  2011-10-23 15:23 ` [PATCH 2/2] crypto: lrw: " Jussi Kivilinna
  0 siblings, 2 replies; 3+ messages in thread
From: Jussi Kivilinna @ 2011-10-23 15:23 UTC (permalink / raw)
  To: linux-crypto; +Cc: Herbert Xu, David S. Miller

These patches fix bug in xts_crypt()/lrw_crypt() where nblocks is
not updated in the block walk loop.

This causes nblocks to be left at 0, after blkcipher_walk_done() call.
This leads 'do { ... } while (nblocks > 0)' loop to be run one extra
time with nblocks == 0 and at end of do-while loop nblocks gets updated
correctly.

---

Jussi Kivilinna (2):
      crypto: xts: fix nblocks not being updated in walk loop
      crypto: lrw: fix nblocks not being updated in walk loop


 crypto/lrw.c |    1 +
 crypto/xts.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] crypto: xts: fix nblocks not being updated in walk loop
  2011-10-23 15:23 [PATCH 0/2] Fixes for parallel XTS/LRW patch series Jussi Kivilinna
@ 2011-10-23 15:23 ` Jussi Kivilinna
  2011-10-23 15:23 ` [PATCH 2/2] crypto: lrw: " Jussi Kivilinna
  1 sibling, 0 replies; 3+ messages in thread
From: Jussi Kivilinna @ 2011-10-23 15:23 UTC (permalink / raw)
  To: linux-crypto; +Cc: Herbert Xu, David S. Miller

In xts_crypt() function, nblocks should be updated after blkcipher_walk_done
call.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
 crypto/xts.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/crypto/xts.c b/crypto/xts.c
index 5681d66..ca1608f 100644
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -229,6 +229,7 @@ first:
 		if (!nbytes)
 			break;
 
+		nblocks = min(nbytes / bsize, max_blks);
 		src = (be128 *)walk.src.virt.addr;
 		dst = (be128 *)walk.dst.virt.addr;
 	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] crypto: lrw: fix nblocks not being updated in walk loop
  2011-10-23 15:23 [PATCH 0/2] Fixes for parallel XTS/LRW patch series Jussi Kivilinna
  2011-10-23 15:23 ` [PATCH 1/2] crypto: xts: fix nblocks not being updated in walk loop Jussi Kivilinna
@ 2011-10-23 15:23 ` Jussi Kivilinna
  1 sibling, 0 replies; 3+ messages in thread
From: Jussi Kivilinna @ 2011-10-23 15:23 UTC (permalink / raw)
  To: linux-crypto; +Cc: Herbert Xu, David S. Miller

In lrw_crypt() function, nblocks should be updated after blkcipher_walk_done
call.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
 crypto/lrw.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/crypto/lrw.c b/crypto/lrw.c
index 66c4d22..ba42acc 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -284,6 +284,7 @@ first:
 		if (!nbytes)
 			break;
 
+		nblocks = min(nbytes / bsize, max_blks);
 		src = (be128 *)walk.src.virt.addr;
 		dst = (be128 *)walk.dst.virt.addr;
 	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-23 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-23 15:23 [PATCH 0/2] Fixes for parallel XTS/LRW patch series Jussi Kivilinna
2011-10-23 15:23 ` [PATCH 1/2] crypto: xts: fix nblocks not being updated in walk loop Jussi Kivilinna
2011-10-23 15:23 ` [PATCH 2/2] crypto: lrw: " Jussi Kivilinna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox