aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/crypto/aes.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-05-16 08:09:29 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2006-06-26 03:34:39 -0400
commit6c2bb98bc33ae33c7a33a133a4cd5a06395fece5 (patch)
tree96684cd2c473cd05d651ce1fa3dd72b1b4b19b09 /arch/x86_64/crypto/aes.c
parent43600106e32809a4dead79fec67a63e9860e3d5d (diff)
[CRYPTO] all: Pass tfm instead of ctx to algorithms
Up until now algorithms have been happy to get a context pointer since they know everything that's in the tfm already (e.g., alignment, block size). However, once we have parameterised algorithms, such information will be specific to each tfm. So the algorithm API needs to be changed to pass the tfm structure instead of the context pointer. This patch is basically a text substitution. The only tricky bit is the assembly routines that need to get the context pointer offset through asm-offsets.h. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86_64/crypto/aes.c')
-rw-r--r--arch/x86_64/crypto/aes.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86_64/crypto/aes.c b/arch/x86_64/crypto/aes.c
index 6f77e7700d32..d6f8e0463b5d 100644
--- a/arch/x86_64/crypto/aes.c
+++ b/arch/x86_64/crypto/aes.c
@@ -227,10 +227,10 @@ static void __init gen_tabs(void)
227 t ^= E_KEY[8 * i + 7]; E_KEY[8 * i + 15] = t; \ 227 t ^= E_KEY[8 * i + 7]; E_KEY[8 * i + 15] = t; \
228} 228}
229 229
230static int aes_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, 230static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
231 u32 *flags) 231 unsigned int key_len, u32 *flags)
232{ 232{
233 struct aes_ctx *ctx = ctx_arg; 233 struct aes_ctx *ctx = crypto_tfm_ctx(tfm);
234 const __le32 *key = (const __le32 *)in_key; 234 const __le32 *key = (const __le32 *)in_key;
235 u32 i, j, t, u, v, w; 235 u32 i, j, t, u, v, w;
236 236
@@ -283,8 +283,8 @@ static int aes_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len,
283 return 0; 283 return 0;
284} 284}
285 285
286extern void aes_encrypt(void *ctx_arg, u8 *out, const u8 *in); 286extern void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in);
287extern void aes_decrypt(void *ctx_arg, u8 *out, const u8 *in); 287extern void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in);
288 288
289static struct crypto_alg aes_alg = { 289static struct crypto_alg aes_alg = {
290 .cra_name = "aes", 290 .cra_name = "aes",