[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090115031454.GA27821@gondor.apana.org.au>
Date: Thu, 15 Jan 2009 14:14:54 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Huang Ying <ying.huang@...el.com>
Cc: Sebastian Siewior <linux-crypto@...breakpoint.cc>,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org
Subject: Re: [RFC PATCH crypto -v3 1/2] AES-NI: Add support to access
underlying blkcipher under cryptd ablkcipher
On Wed, Jan 14, 2009 at 03:44:06PM +0800, Huang Ying wrote:
> cryptd_alloc_ablkcipher() will allocate a cryptd-ed ablkcipher for
> specified algorithm name. The new allocated one is guaranteed to be
> cryptd-ed ablkcipher, so the blkcipher underlying can be gotten via
> cryptd_ablkcipher_child().
>
> Signed-off-by: Huang Ying <ying.huang@...el.com>
Thanks for the patch!
> +struct crypto_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
> + u32 type, u32 mask)
It should have its own type so that we get compiler type checking.
Something like,
struct cryptd_ablkcipher {
struct crypto_ablkcipher *cipher;
};
> + if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME,
> + "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME)
> + return ERR_PTR(-EINVAL);
> + return crypto_alloc_ablkcipher(cryptd_alg_name, type, mask);
We should also check that the new tfm's module matches ours, i.e.,
crypto_ablkcipher_tfm(cipher)->__crt_alg->cra_module ==
THIS_MODULE
Granted this doesn't do much if we're built-in but it's better
than nothing.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists