Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: atmel - remove unnecessary alignmask for ahashes

The crypto API's support for alignmasks for ahash algorithms is nearly
useless, as its only effect is to cause the API to align the key and
result buffers. The drivers that happen to be specifying an alignmask
for ahash rarely actually need it. When they do, it's easily fixable,
especially considering that these buffers cannot be used for DMA.

In preparation for removing alignmask support from ahash, this patch
makes the atmel driver no longer use it. This driver didn't actually
rely on it; it only writes to the result buffer in
atmel_sha_copy_ready_hash(), simply using memcpy(). And this driver
didn't set an alignmask for any keyed hash algorithms, so the key buffer
need not be considered.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
a5e12d04 028a1447

-2
-2
drivers/crypto/atmel-sha.c
··· 1300 1300 .halg.base.cra_name = "sha384", 1301 1301 .halg.base.cra_driver_name = "atmel-sha384", 1302 1302 .halg.base.cra_blocksize = SHA384_BLOCK_SIZE, 1303 - .halg.base.cra_alignmask = 0x3, 1304 1303 1305 1304 .halg.digestsize = SHA384_DIGEST_SIZE, 1306 1305 }, ··· 1307 1308 .halg.base.cra_name = "sha512", 1308 1309 .halg.base.cra_driver_name = "atmel-sha512", 1309 1310 .halg.base.cra_blocksize = SHA512_BLOCK_SIZE, 1310 - .halg.base.cra_alignmask = 0x3, 1311 1311 1312 1312 .halg.digestsize = SHA512_DIGEST_SIZE, 1313 1313 },