aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/crypto.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-07-06 13:53:29 -0700
committerDavid S. Miller <davem@davemloft.net>2005-07-06 13:53:29 -0700
commitfbdae9f3e7fb57c07cb0d973f113eb25da2e8ff2 (patch)
treeb20909c92c2d48ab449343967b1c365732d7e4ff /include/linux/crypto.h
parent[CRYPTO] Make crypto_alg_lookup static (diff)
downloadlinux-dev-fbdae9f3e7fb57c07cb0d973f113eb25da2e8ff2.tar.xz
linux-dev-fbdae9f3e7fb57c07cb0d973f113eb25da2e8ff2.zip
[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>
Diffstat (limited to '')
-rw-r--r--include/linux/crypto.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index ac9d49beecd3..5e2bcc636a02 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -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];