Commit 2c221ad3 authored by Herbert Xu's avatar Herbert Xu

crypto: ccm - Use crypto_aead_set_reqsize helper

This patch uses the crypto_aead_set_reqsize helper to avoid directly
touching the internals of aead.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 6650d09b
...@@ -453,9 +453,9 @@ static int crypto_ccm_init_tfm(struct crypto_tfm *tfm) ...@@ -453,9 +453,9 @@ static int crypto_ccm_init_tfm(struct crypto_tfm *tfm)
align = crypto_tfm_alg_alignmask(tfm); align = crypto_tfm_alg_alignmask(tfm);
align &= ~(crypto_tfm_ctx_alignment() - 1); align &= ~(crypto_tfm_ctx_alignment() - 1);
tfm->crt_aead.reqsize = align + crypto_aead_set_reqsize(__crypto_aead_cast(tfm),
sizeof(struct crypto_ccm_req_priv_ctx) + align + sizeof(struct crypto_ccm_req_priv_ctx) +
crypto_ablkcipher_reqsize(ctr); crypto_ablkcipher_reqsize(ctr));
return 0; return 0;
...@@ -729,10 +729,10 @@ static int crypto_rfc4309_init_tfm(struct crypto_tfm *tfm) ...@@ -729,10 +729,10 @@ static int crypto_rfc4309_init_tfm(struct crypto_tfm *tfm)
align = crypto_aead_alignmask(aead); align = crypto_aead_alignmask(aead);
align &= ~(crypto_tfm_ctx_alignment() - 1); align &= ~(crypto_tfm_ctx_alignment() - 1);
tfm->crt_aead.reqsize = sizeof(struct aead_request) + crypto_aead_set_reqsize(__crypto_aead_cast(tfm),
ALIGN(crypto_aead_reqsize(aead), sizeof(struct aead_request) +
crypto_tfm_ctx_alignment()) + ALIGN(crypto_aead_reqsize(aead), crypto_tfm_ctx_alignment()) +
align + 16; align + 16);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment