mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
[CRYPTO] digest: Add alignment handling
Some hash modules load/store data words directly. The digest layer should pass properly aligned buffer to update()/final() method. This patch also add cra_alignmask to some hash modules. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
d00e708cef
commit
e1147d8f47
@@ -281,6 +281,7 @@ static struct crypto_alg sha512 = {
|
||||
.cra_blocksize = SHA512_HMAC_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct sha512_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_alignmask = 3,
|
||||
.cra_list = LIST_HEAD_INIT(sha512.cra_list),
|
||||
.cra_u = { .digest = {
|
||||
.dia_digestsize = SHA512_DIGEST_SIZE,
|
||||
@@ -295,6 +296,7 @@ static struct crypto_alg sha384 = {
|
||||
.cra_flags = CRYPTO_ALG_TYPE_DIGEST,
|
||||
.cra_blocksize = SHA384_HMAC_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct sha512_ctx),
|
||||
.cra_alignmask = 3,
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_list = LIST_HEAD_INIT(sha384.cra_list),
|
||||
.cra_u = { .digest = {
|
||||
|
||||
Reference in New Issue
Block a user