mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[CRYPTO] Ensure cit_iv is aligned correctly
This patch ensures that cit_iv is aligned according to cra_alignmask by allocating it as part of the tfm structure. As a side effect the crypto layer will also guarantee that the tfm ctx area has enough space to be aligned by cra_alignmask. This allows us to remove the extra space reservation from the Padlock driver. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
176c3652c5
commit
fbdae9f3e7
5 changed files with 72 additions and 11 deletions
|
@ -288,6 +288,11 @@ static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm)
|
|||
return tfm->__crt_alg->cra_digest.dia_digestsize;
|
||||
}
|
||||
|
||||
static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
|
||||
{
|
||||
return tfm->__crt_alg->cra_alignmask;
|
||||
}
|
||||
|
||||
static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm)
|
||||
{
|
||||
return (void *)&tfm[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue