aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-21 09:33:19 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-21 09:33:19 -0800
commitec1248e70edc5cf7b485efcc7b41e44e10f422e5 (patch)
tree80ca10a1ad9dc572e131a56a93fcf0c63c14d168 /include
parent3d1f337b3e7378923c89f37afb573a918ef40be5 (diff)
parent55e9dce37ddf3ab358ba1d1e9eef4ee4bd8174a6 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6: [CRYPTO] aes: Fixed array boundary violation [CRYPTO] tcrypt: Fix key alignment [CRYPTO] all: Add missing cra_alignmask [CRYPTO] all: Use kzalloc where possible [CRYPTO] api: Align tfm context as wide as possible [CRYPTO] twofish: Use rol32/ror32 where appropriate
Diffstat (limited to 'include')
-rw-r--r--include/linux/crypto.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index d88bf8aa8b4..0ab1bc1152c 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -229,6 +229,8 @@ struct crypto_tfm {
} crt_u;
struct crypto_alg *__crt_alg;
+
+ char __crt_ctx[] __attribute__ ((__aligned__));
};
/*
@@ -301,7 +303,13 @@ static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm)
{
- return (void *)&tfm[1];
+ return tfm->__crt_ctx;
+}
+
+static inline unsigned int crypto_tfm_ctx_alignment(void)
+{
+ struct crypto_tfm *tfm;
+ return __alignof__(tfm->__crt_ctx);
}
/*