Commit c2110f28 authored by Herbert Xu's avatar Herbert Xu

crypto: api - Include alignment in crypto_alg_extsize

This patch ensures that the tfm context always has enough extra
memory to ensure that it is aligned according to cra_alignment.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 5c98d620
......@@ -980,7 +980,8 @@ EXPORT_SYMBOL_GPL(crypto_xor);
unsigned int crypto_alg_extsize(struct crypto_alg *alg)
{
return alg->cra_ctxsize;
return alg->cra_ctxsize +
(alg->cra_alignmask & ~(crypto_tfm_ctx_alignment() - 1));
}
EXPORT_SYMBOL_GPL(crypto_alg_extsize);
......
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