summaryrefslogtreecommitdiff
path: root/crypto/blake2b_generic.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2023-10-18 22:53:34 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2023-10-27 18:04:24 +0800
commitb510a3de6eef2ca0d324f320df639441fb8526cb (patch)
tree851ac701cd3b50ed63194a77e0572f887b5dbbd0 /crypto/blake2b_generic.c
parentd7a3619daea9014f9e5b68ec4b3e791c7c05173a (diff)
downloadlinux-crypto-b510a3de6eef2ca0d324f320df639441fb8526cb.tar.gz
linux-crypto-b510a3de6eef2ca0d324f320df639441fb8526cb.zip
crypto: hmac - remove unnecessary alignment logic
The hmac template is setting its alignmask to that of its underlying unkeyed hash algorithm, and it is aligning the ipad and opad fields in its tfm context to that alignment. However, hmac does not actually need any sort of alignment itself, which makes this pointless except to keep the pads aligned to what the underlying algorithm prefers. But very few shash algorithms actually set an alignmask, and it is being removed from those remaining ones; also, after setkey, the pads are only passed to crypto_shash_import and crypto_shash_export which ignore the alignmask. Therefore, make the hmac template stop setting an alignmask and simply use natural alignment for ipad and opad. Note, this change also moves the pads from the beginning of the tfm context to the end, which makes much more sense; the variable-length fields should be at the end. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/blake2b_generic.c')
0 files changed, 0 insertions, 0 deletions