linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / crypto / tea.c
index 5367adc..a6a02b3 100644 (file)
@@ -45,10 +45,10 @@ struct xtea_ctx {
        u32 KEY[4];
 };
 
-static int tea_setkey(struct crypto_tfm *tfm, const u8 *in_key,
-                     unsigned int key_len, u32 *flags)
-{
-       struct tea_ctx *ctx = crypto_tfm_ctx(tfm);
+static int tea_setkey(void *ctx_arg, const u8 *in_key,
+                       unsigned int key_len, u32 *flags)
+{ 
+       struct tea_ctx *ctx = ctx_arg;
        const __le32 *key = (const __le32 *)in_key;
        
        if (key_len != 16)
@@ -66,11 +66,12 @@ static int tea_setkey(struct crypto_tfm *tfm, const u8 *in_key,
 
 }
 
-static void tea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
-{
+static void tea_encrypt(void *ctx_arg, u8 *dst, const u8 *src)
+{ 
        u32 y, z, n, sum = 0;
        u32 k0, k1, k2, k3;
-       struct tea_ctx *ctx = crypto_tfm_ctx(tfm);
+
+       struct tea_ctx *ctx = ctx_arg;
        const __le32 *in = (const __le32 *)src;
        __le32 *out = (__le32 *)dst;
 
@@ -94,11 +95,11 @@ static void tea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
        out[1] = cpu_to_le32(z);
 }
 
-static void tea_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
-{
+static void tea_decrypt(void *ctx_arg, u8 *dst, const u8 *src)
+{ 
        u32 y, z, n, sum;
        u32 k0, k1, k2, k3;
-       struct tea_ctx *ctx = crypto_tfm_ctx(tfm);
+       struct tea_ctx *ctx = ctx_arg;
        const __le32 *in = (const __le32 *)src;
        __le32 *out = (__le32 *)dst;
 
@@ -124,10 +125,10 @@ static void tea_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
        out[1] = cpu_to_le32(z);
 }
 
-static int xtea_setkey(struct crypto_tfm *tfm, const u8 *in_key,
-                      unsigned int key_len, u32 *flags)
-{
-       struct xtea_ctx *ctx = crypto_tfm_ctx(tfm);
+static int xtea_setkey(void *ctx_arg, const u8 *in_key,
+                       unsigned int key_len, u32 *flags)
+{ 
+       struct xtea_ctx *ctx = ctx_arg;
        const __le32 *key = (const __le32 *)in_key;
        
        if (key_len != 16)
@@ -145,11 +146,12 @@ static int xtea_setkey(struct crypto_tfm *tfm, const u8 *in_key,
 
 }
 
-static void xtea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
-{
+static void xtea_encrypt(void *ctx_arg, u8 *dst, const u8 *src)
+{ 
        u32 y, z, sum = 0;
        u32 limit = XTEA_DELTA * XTEA_ROUNDS;
-       struct xtea_ctx *ctx = crypto_tfm_ctx(tfm);
+
+       struct xtea_ctx *ctx = ctx_arg;
        const __le32 *in = (const __le32 *)src;
        __le32 *out = (__le32 *)dst;
 
@@ -166,10 +168,10 @@ static void xtea_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
        out[1] = cpu_to_le32(z);
 }
 
-static void xtea_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
-{
+static void xtea_decrypt(void *ctx_arg, u8 *dst, const u8 *src)
+{ 
        u32 y, z, sum;
-       struct tea_ctx *ctx = crypto_tfm_ctx(tfm);
+       struct tea_ctx *ctx = ctx_arg;
        const __le32 *in = (const __le32 *)src;
        __le32 *out = (__le32 *)dst;
 
@@ -189,11 +191,12 @@ static void xtea_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
 }
 
 
-static void xeta_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
-{
+static void xeta_encrypt(void *ctx_arg, u8 *dst, const u8 *src)
+{ 
        u32 y, z, sum = 0;
        u32 limit = XTEA_DELTA * XTEA_ROUNDS;
-       struct xtea_ctx *ctx = crypto_tfm_ctx(tfm);
+
+       struct xtea_ctx *ctx = ctx_arg;
        const __le32 *in = (const __le32 *)src;
        __le32 *out = (__le32 *)dst;
 
@@ -210,10 +213,10 @@ static void xeta_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
        out[1] = cpu_to_le32(z);
 }
 
-static void xeta_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
-{
+static void xeta_decrypt(void *ctx_arg, u8 *dst, const u8 *src)
+{ 
        u32 y, z, sum;
-       struct tea_ctx *ctx = crypto_tfm_ctx(tfm);
+       struct tea_ctx *ctx = ctx_arg;
        const __le32 *in = (const __le32 *)src;
        __le32 *out = (__le32 *)dst;