Skip to content

crypto: lrw - Fixes and improvements

Ondrej Mosnacek dm-devel linux-crypto stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest4 patches 3 repliesIn review

Changes in v4 from the cover letter

- applied various corrections/suggestions from Eric Biggers
- added a fix for buggy behavior on counter wrap-around (+ test vector)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4crypto: lrw - Fix out-of bounds access on counter overflowcrypto/lrw.c+6 -10 replies
2/4crypto: testmgr - Add test for LRW counter wrap-aroundcrypto/testmgr.h+21 -00 replies
3/4crypto: lrw - Optimize tweak computationcrypto/lrw.c+37 -240 replies
4/4crypto: lrw - Do not use auxiliary buffercrypto/lrw.c+51 -2290 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/4] crypto: lrw - Fixes and improvements

This patchset contains a corner-case fix and several improvements for the LRW template.

The first patch fixes an out-of-bounds array access (and subsequently incorrect cipher output) when the LRW counter goes from all ones to all zeros. This patch should be applied to the crypto-2.6 tree and also go to stable.

The second patch adds a test vector for lrw(aes) that covers the above bug.

The third patch is a small optimization of the LRW tweak computation.

The fourth patch is a follow-up to a similar patch for XTS (it simplifies away the use of dynamically allocated auxiliary buffer to cache the computed tweak values):
https://patchwork.kernel.org/patch/10588775/

Patches 2-4 should be applied only to cryptodev-2.6, but they all depend on the first patch.

Changes in v4:
- applied various corrections/suggestions from Eric Biggers
- added a fix for buggy behavior on counter wrap-around (+ test vector)

v3: https://www.spinics.net/lists/linux-crypto/msg34946.html
Changes in v3:
- fix a copy-paste error

v2: https://www.spinics.net/lists/linux-crypto/msg34890.html
Changes in v2:
- small cleanup suggested by Eric Biggers

v1: https://www.spinics.net/lists/linux-crypto/msg34871.html

Ondrej Mosnacek (4):
crypto: lrw - Fix out-of bounds access on counter overflow
crypto: testmgr - Add test for LRW counter wrap-around
crypto: lrw - Optimize tweak computation
crypto: lrw - Do not use auxiliary buffer

 crypto/lrw.c     | 342 +++++++++++++----------------------------------
 crypto/testmgr.h |  21 +++
 2 files changed, 112 insertions(+), 251 deletions(-)
Signature · 1 line
2.17.1