Skip to content

Commit 2d91a83

Browse files
ebiggersherbertx
authored andcommitted
crypto: rockchip - 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 rockchip driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in rk_hash_run(), already using put_unaligned_le32(). And this driver only supports unkeyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f35a4e2 commit 2d91a83

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/crypto/rockchip/rk3288_crypto_ahash.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ struct rk_crypto_tmp rk_ahash_sha1 = {
393393
CRYPTO_ALG_NEED_FALLBACK,
394394
.cra_blocksize = SHA1_BLOCK_SIZE,
395395
.cra_ctxsize = sizeof(struct rk_ahash_ctx),
396-
.cra_alignmask = 3,
397396
.cra_module = THIS_MODULE,
398397
}
399398
}
@@ -426,7 +425,6 @@ struct rk_crypto_tmp rk_ahash_sha256 = {
426425
CRYPTO_ALG_NEED_FALLBACK,
427426
.cra_blocksize = SHA256_BLOCK_SIZE,
428427
.cra_ctxsize = sizeof(struct rk_ahash_ctx),
429-
.cra_alignmask = 3,
430428
.cra_module = THIS_MODULE,
431429
}
432430
}
@@ -459,7 +457,6 @@ struct rk_crypto_tmp rk_ahash_md5 = {
459457
CRYPTO_ALG_NEED_FALLBACK,
460458
.cra_blocksize = SHA1_BLOCK_SIZE,
461459
.cra_ctxsize = sizeof(struct rk_ahash_ctx),
462-
.cra_alignmask = 3,
463460
.cra_module = THIS_MODULE,
464461
}
465462
}

0 commit comments

Comments
 (0)