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))
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;