X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=crypto%2Fdes.c;h=2d74cab40c3e497c9cd356c4b8710e689bd62fb5;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=a9d3c235a6af969447848e3832d018f055f8a262;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/crypto/des.c b/crypto/des.c index a9d3c235a..2d74cab40 100644 --- a/crypto/des.c +++ b/crypto/des.c @@ -783,10 +783,9 @@ static void dkey(u32 *pe, const u8 *k) } } -static int des_setkey(struct crypto_tfm *tfm, const u8 *key, - unsigned int keylen, u32 *flags) +static int des_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) { - struct des_ctx *dctx = crypto_tfm_ctx(tfm); + struct des_ctx *dctx = ctx; u32 tmp[DES_EXPKEY_WORDS]; int ret; @@ -804,10 +803,9 @@ static int des_setkey(struct crypto_tfm *tfm, const u8 *key, return 0; } -static void des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void des_encrypt(void *ctx, u8 *dst, const u8 *src) { - struct des_ctx *ctx = crypto_tfm_ctx(tfm); - const u32 *K = ctx->expkey; + const u32 *K = ((struct des_ctx *)ctx)->expkey; const __le32 *s = (const __le32 *)src; __le32 *d = (__le32 *)dst; u32 L, R, A, B; @@ -827,10 +825,9 @@ static void des_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) d[1] = cpu_to_le32(L); } -static void des_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void des_decrypt(void *ctx, u8 *dst, const u8 *src) { - struct des_ctx *ctx = crypto_tfm_ctx(tfm); - const u32 *K = ctx->expkey + DES_EXPKEY_WORDS - 2; + const u32 *K = ((struct des_ctx *)ctx)->expkey + DES_EXPKEY_WORDS - 2; const __le32 *s = (const __le32 *)src; __le32 *d = (__le32 *)dst; u32 L, R, A, B; @@ -863,11 +860,11 @@ static void des_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) * property. * */ -static int des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key, +static int des3_ede_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags) { const u32 *K = (const u32 *)key; - struct des3_ede_ctx *dctx = crypto_tfm_ctx(tfm); + struct des3_ede_ctx *dctx = ctx; u32 *expkey = dctx->expkey; if (unlikely(!((K[0] ^ K[2]) | (K[1] ^ K[3])) || @@ -884,9 +881,9 @@ static int des3_ede_setkey(struct crypto_tfm *tfm, const u8 *key, return 0; } -static void des3_ede_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void des3_ede_encrypt(void *ctx, u8 *dst, const u8 *src) { - struct des3_ede_ctx *dctx = crypto_tfm_ctx(tfm); + struct des3_ede_ctx *dctx = ctx; const u32 *K = dctx->expkey; const __le32 *s = (const __le32 *)src; __le32 *d = (__le32 *)dst; @@ -915,9 +912,9 @@ static void des3_ede_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) d[1] = cpu_to_le32(L); } -static void des3_ede_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +static void des3_ede_decrypt(void *ctx, u8 *dst, const u8 *src) { - struct des3_ede_ctx *dctx = crypto_tfm_ctx(tfm); + struct des3_ede_ctx *dctx = ctx; const u32 *K = dctx->expkey + DES3_EDE_EXPKEY_WORDS - 2; const __le32 *s = (const __le32 *)src; __le32 *d = (__le32 *)dst;