Skip to content

Commit 13d13bb

Browse files
ebiggersherbertx
authored andcommitted
crypto: s5p-sss - 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 s5p-sss driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in s5p_hash_copy_result(), simply using memcpy(). 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 d39caf8 commit 13d13bb

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/crypto/s5p-sss.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,6 @@
224224
/* HASH HW constants */
225225
#define BUFLEN HASH_BLOCK_SIZE
226226

227-
#define SSS_HASH_DMA_LEN_ALIGN 8
228-
#define SSS_HASH_DMA_ALIGN_MASK (SSS_HASH_DMA_LEN_ALIGN - 1)
229-
230227
#define SSS_HASH_QUEUE_LENGTH 10
231228

232229
/**
@@ -1746,7 +1743,6 @@ static struct ahash_alg algs_sha1_md5_sha256[] = {
17461743
CRYPTO_ALG_NEED_FALLBACK,
17471744
.cra_blocksize = HASH_BLOCK_SIZE,
17481745
.cra_ctxsize = sizeof(struct s5p_hash_ctx),
1749-
.cra_alignmask = SSS_HASH_DMA_ALIGN_MASK,
17501746
.cra_module = THIS_MODULE,
17511747
.cra_init = s5p_hash_cra_init,
17521748
.cra_exit = s5p_hash_cra_exit,
@@ -1771,7 +1767,6 @@ static struct ahash_alg algs_sha1_md5_sha256[] = {
17711767
CRYPTO_ALG_NEED_FALLBACK,
17721768
.cra_blocksize = HASH_BLOCK_SIZE,
17731769
.cra_ctxsize = sizeof(struct s5p_hash_ctx),
1774-
.cra_alignmask = SSS_HASH_DMA_ALIGN_MASK,
17751770
.cra_module = THIS_MODULE,
17761771
.cra_init = s5p_hash_cra_init,
17771772
.cra_exit = s5p_hash_cra_exit,
@@ -1796,7 +1791,6 @@ static struct ahash_alg algs_sha1_md5_sha256[] = {
17961791
CRYPTO_ALG_NEED_FALLBACK,
17971792
.cra_blocksize = HASH_BLOCK_SIZE,
17981793
.cra_ctxsize = sizeof(struct s5p_hash_ctx),
1799-
.cra_alignmask = SSS_HASH_DMA_ALIGN_MASK,
18001794
.cra_module = THIS_MODULE,
18011795
.cra_init = s5p_hash_cra_init,
18021796
.cra_exit = s5p_hash_cra_exit,

0 commit comments

Comments
 (0)