Hi Evgeniy:

On Tue, May 01, 2007 at 06:23:29PM +0400, Evgeniy Polyakov wrote:
>
> As far as I understand, this callback is called each time new tfm is
> going to be created? And it is called for each crypto_template

cryptd_blkcipher_init_tfm/cryptd_blkcipher_exit_tfm are per-tfm while
cryptd_alloc_blkcipher/cryptd_alloc are per-instance.

> registered in the system, so it is task of the template to detect that
> requested cypher tb[crypto_alg-1] is not supported by template.
> Am I correct?

If the requested instance is not supported by this template then we'll
just fail in cryptd_alloc.  Right now only BLKCIPHER cipher is supported
so everything else will simply fail.

> If so, could it be better to have set of flags for template which would
> show which operations are supported?
> For example HIFH adapter can not perform blowfish encryption, but it
> will be requested to do so each time new tfm is being requested, if my
> analysis correct...

Sorry, I think I've misled you there.  For something like the HIFH
adapter you wouldn't do a template at all (well, not until we start
expressing supported key lengths through templates).

You'd simply register an algorithm of type BLKCIPHER | CRYPTO_ALG_ASYNC
for each algorithm that you support.  You'd set the name of each of these
according to their algorithm.  So for example AES would just be registered
as "aes" (of course, you'd set your driver name differently).

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
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-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to