On Tue, Oct 23, 2007 at 03:40:08PM -0500, Michael Halcrow wrote:
> On Tue, Oct 23, 2007 at 03:26:29PM -0500, Joy Latten wrote:
> > +   unsigned int countersize;
> 
> It's somewhat nicer to just use size_t in the kernel for these sorts
> of data types. If you care about the exact number of bytes used by the
> variable, types like u32 make the code more parsable.

I don't see how this makes a difference here at all.

> > +   err = crypto_attr_u32(tb[4], &countersize);
> > +   if (err)
> > +           goto out_put_alg;
> 
> It's also nice to have printk's along error paths. Syslogs down the
> road tend to be less cryptic.

Please don't.  That's what error return values are for.  Adding
printk's means that we'd have to think about limiting them later
when this is opened up for user-space access.

> > -           test_cipher("ctr(aes,4,8)", ENCRYPT, aes_ctr_enc_tv_template,
> > +           test_cipher("ctr(aes,4,8,4)", ENCRYPT, aes_ctr_enc_tv_template,
> >                         AES_CTR_ENC_TEST_VECTORS);
> > -           test_cipher("ctr(aes,4,8)", DECRYPT, aes_ctr_dec_tv_template,
> > +           test_cipher("ctr(aes,4,8,4)", DECRYPT, aes_ctr_dec_tv_template,
> >                         AES_CTR_DEC_TEST_VECTORS);
> 
> I have never been particularly thrilled about the the string-based
> method of parameterizing block ciphers for in-kernel API calls.

If you have a better suggestion I'd love to hear it!

Thanks,
-- 
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