Skip to content

crypto: fix alignmask handling

Ard Biesheuvel linux-crypto stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9crypto: michael_mic - fix broken misalignment handlingcrypto/michael_mic.c+12 -190 replies
2/9crypto: serpent - get rid of obsolete tnepres variantcrypto/Kconfig crypto/serpent_generic.c crypto/tcrypt.c +2 more+7 -1690 replies
3/9crypto: serpent - use unaligned accessors instead of alignmaskcrypto/serpent_generic.c+17 -270 replies
4/9crypto: blowfish - use unaligned accessors instead of alignmaskcrypto/blowfish_generic.c+9 -140 replies
5/9crypto: camellia - use unaligned accessors instead of alignmaskcrypto/camellia_generic.c+16 -290 replies
6/9crypto: cast5 - use unaligned accessors instead of alignmaskcrypto/cast5_generic.c+9 -140 replies
7/9crypto: cast6 - use unaligned accessors instead of alignmaskcrypto/cast6_generic.c+17 -220 replies
8/9crypto: fcrypt - drop unneeded alignmaskcrypto/fcrypt.c+0 -10 replies
9/9crypto: twofish - use unaligned accessors instead of alignmaskcrypto/twofish_generic.c+3 -80 replies

Reviews trailers per patch

None of the 9 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEric Biggers
SeriesR-b
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] crypto: fix alignmask handling

Some generic implementations of vintage ciphers rely on alignmasks to ensure that the input is presented with the right alignment. Given that these are all C implementations, which may execute on architectures that don't care about alignment in the first place, it is better to use the unaligned accessors, which will deal with the misalignment in a way that is appropriate for the architecture in question (and in many cases, this means simply ignoring the misalignment, as the hardware doesn't care either)

So fix this across a number of implementations. Patch #1 stands out because michael_mic.c was broken in spite of the alignmask. Patch #2 removes tnepres instead of updating it, given that there is no point in keeping it.

The remaining patches all update generic ciphers that are outdated but still used, and which are the only implementations available on most architectures other than x86.

Ard Biesheuvel (9):
crypto: michael_mic - fix broken misalignment handling
crypto: serpent - get rid of obsolete tnepres variant
crypto: serpent - use unaligned accessors instead of alignmask
crypto: blowfish - use unaligned accessors instead of alignmask
crypto: camellia - use unaligned accessors instead of alignmask
crypto: cast5 - use unaligned accessors instead of alignmask
crypto: cast6 - use unaligned accessors instead of alignmask
crypto: fcrypt - drop unneeded alignmask
crypto: twofish - use unaligned accessors instead of alignmask

 crypto/Kconfig            |   3 +-
 crypto/blowfish_generic.c |  23 ++--
 crypto/camellia_generic.c |  45 +++----
 crypto/cast5_generic.c    |  23 ++--
 crypto/cast6_generic.c    |  39 +++---
 crypto/fcrypt.c           |   1 -
 crypto/michael_mic.c      |  31 ++---
 crypto/serpent_generic.c  | 126 ++++----------------
 crypto/tcrypt.c           |   6 +-
 crypto/testmgr.c          |   6 -
 crypto/testmgr.h          |  79 ------------
 crypto/twofish_generic.c  |  11 +-
 12 files changed, 90 insertions(+), 303 deletions(-)
Signature · 1 line
2.20.1