linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / crypto / api.c
index a5317b2..e26156f 100644 (file)
@@ -165,31 +165,26 @@ static unsigned int crypto_ctxsize(struct crypto_alg *alg, int flags)
                break;
        }
 
-       return len + (alg->cra_alignmask & ~(crypto_tfm_ctx_alignment() - 1));
+       return len + alg->cra_alignmask;
 }
 
-struct crypto_tfm *crypto_alloc_tfm2(const char *name, u32 flags,
-                                    int nomodload)
+struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags)
 {
        struct crypto_tfm *tfm = NULL;
        struct crypto_alg *alg;
        unsigned int tfm_size;
 
-       if (!nomodload) {
-               alg = crypto_alg_mod_lookup(name);
-       }
-       else {
-               alg = crypto_alg_lookup(name);
-       }
-
+       alg = crypto_alg_mod_lookup(name);
        if (alg == NULL)
                goto out;
 
        tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, flags);
-       tfm = kzalloc(tfm_size, GFP_KERNEL);
+       tfm = kmalloc(tfm_size, GFP_KERNEL);
        if (tfm == NULL)
                goto out_put;
 
+       memset(tfm, 0, tfm_size);
+       
        tfm->__crt_alg = alg;
        
        if (crypto_init_flags(tfm, flags))
@@ -211,11 +206,6 @@ out:
        return tfm;
 }
 
-struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags)
-{
-       return crypto_alloc_tfm2(name, flags, 0);
-}
-
 void crypto_free_tfm(struct crypto_tfm *tfm)
 {
        struct crypto_alg *alg;