summaryrefslogtreecommitdiff
path: root/crypto/vmac.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
commit25c74a39e0f637a44982c3820a583755aedc9811 (patch)
tree8524f07e4079099e8f3a39d80dbb223ffe1f96ea /crypto/vmac.c
parentf9dc9f2e4072de356614d95940c9d7f448a4e334 (diff)
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/vmac.c')
0 files changed, 0 insertions, 0 deletions