Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Michael Halcrow <mike@halcrow.us>
To: Joy Latten <latten@austin.ibm.com>
Cc: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au,
	mikko.herranen@cs.helsinki.fi
Subject: Re: [PATCH 1/1]: Add countersize to CTR
Date: Tue, 23 Oct 2007 15:40:08 -0500	[thread overview]
Message-ID: <20071023204007.GT1635@halcrow.us> (raw)
In-Reply-To: <200710232026.l9NKQTkC000737@faith.austin.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

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.

> +	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.

> -		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.

Mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 481 bytes --]

  reply	other threads:[~2007-10-23 20:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-23 20:26 [PATCH 1/1]: Add countersize to CTR Joy Latten
2007-10-23 20:40 ` Michael Halcrow [this message]
2007-10-24  0:42   ` Herbert Xu
2007-10-24  0:59     ` Michael Halcrow
2007-10-24  1:19       ` Herbert Xu
2007-10-24  3:22         ` Michael Halcrow
2007-10-24  3:50           ` User-space access to kernel crypto Herbert Xu
2007-10-26  6:59 ` [PATCH 1/1]: Add countersize to CTR Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2007-10-26 19:22 Joy Latten
2007-11-07 15:03 ` 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=20071023204007.GT1635@halcrow.us \
    --to=mike@halcrow.us \
    --cc=herbert@gondor.apana.org.au \
    --cc=latten@austin.ibm.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=mikko.herranen@cs.helsinki.fi \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox