From: Marc St-Jean <Marc_St-Jean@pmc-sierra.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org,
Shane McDonald <Shane_McDonald@pmc-sierra.com>
Subject: Re: Where has CRYPTO_TFM_MODE_nnn gone?
Date: Thu, 14 Jun 2007 15:06:02 -0700 [thread overview]
Message-ID: <4671BBCA.5080508@pmc-sierra.com> (raw)
Herbert Xu wrote:
> On Fri, Jun 08, 2007 at 12:13:17PM -0700, Marc St-Jean wrote:
> >
> > In CBC mode we had a line of code copying cipher_desc.info to get the
> > initialization vector. Such as:
> > /* Copy in IV */
> > memcpy((u8*)(sa->crypt_iv), desc->info,
> > crypto_tfm_alg_ivsize(tfm));
> >
> > Now the only reference to the function I can find is in an IPsec comment
> > from include/net/esp.h. Any tips on getting the size?
>
> We now have two types of ciphers, simple ciphers and block ciphers. The
> former only ever ecnrypts one block at a time, and therefore needs no IV.
> Only block ciphers have IVs.
>
> The other change is that instead of having everything as crypto_tfm they
> all have their own types now. So ciphers are crypto_cipher while block
> ciphers are crypto_blkcipher.
>
> In your case your tfm should be of type crypto_blkcipher. Then you simply
> call crypto_blkcipher_ivsize(tfm) to get the size.
>
> > Thanks, I have been looking at that code but unfortunately it supports
> > fewer cryptos/hashes so does not answer all my questions.
>
> The same concept still applies regardless of the actual number of modes.
>
> Oh and yes you do register it multiple times, once for each combination
> of the blocking mode and the cipher.
Thanks for the info Herbert.
Marc
next reply other threads:[~2007-06-14 22:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-14 22:06 Marc St-Jean [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-06-08 19:13 Where has CRYPTO_TFM_MODE_nnn gone? Marc St-Jean
2007-06-08 22:25 ` Herbert Xu
2007-06-08 0:06 Marc St-Jean
2007-06-08 6:17 ` Herbert Xu
2007-06-08 6:26 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4671BBCA.5080508@pmc-sierra.com \
--to=marc_st-jean@pmc-sierra.com \
--cc=Shane_McDonald@pmc-sierra.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.