mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
d00e708cef
commit
e1147d8f47
6 changed files with 35 additions and 15 deletions
|
|
@ -627,6 +627,7 @@ static struct crypto_alg tgr192 = {
|
|||
.cra_blocksize = TGR192_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tgr192_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_alignmask = 7,
|
||||
.cra_list = LIST_HEAD_INIT(tgr192.cra_list),
|
||||
.cra_u = {.digest = {
|
||||
.dia_digestsize = TGR192_DIGEST_SIZE,
|
||||
|
|
@ -641,6 +642,7 @@ static struct crypto_alg tgr160 = {
|
|||
.cra_blocksize = TGR192_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tgr192_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_alignmask = 7,
|
||||
.cra_list = LIST_HEAD_INIT(tgr160.cra_list),
|
||||
.cra_u = {.digest = {
|
||||
.dia_digestsize = TGR160_DIGEST_SIZE,
|
||||
|
|
@ -655,6 +657,7 @@ static struct crypto_alg tgr128 = {
|
|||
.cra_blocksize = TGR192_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct tgr192_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_alignmask = 7,
|
||||
.cra_list = LIST_HEAD_INIT(tgr128.cra_list),
|
||||
.cra_u = {.digest = {
|
||||
.dia_digestsize = TGR128_DIGEST_SIZE,
|
||||
|
|
|
|||
Loading…
Reference in a new issue