mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Andreas Schwab <schwab@suse.de>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	herbert@gondor.apana.org.au, akpm@osdl.org
Subject: Re: [PATCH] crypto: fix key alignment in tcrypt
Date: Sat, 11 Mar 2006 17:48:41 -0600	[thread overview]
Message-ID: <20060311234841.GI28168@waste.org> (raw)
In-Reply-To: <jeirqktvb0.fsf@sykes.suse.de>

On Sun, Mar 12, 2006 at 12:29:07AM +0100, Andreas Schwab wrote:
> Matt Mackall <mpm@selenic.com> writes:
> 
> > On Wed, Mar 08, 2006 at 11:11:55PM +0900, Atsushi Nemoto wrote:
> >> Force 32-bit alignment on keys in tcrypt test vectors.
> >> 
> >> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> >> 
> >> diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
> >> index 733d07e..050f852 100644
> >> --- a/crypto/tcrypt.h
> >> +++ b/crypto/tcrypt.h
> >> @@ -31,7 +31,7 @@ struct hash_testvec {
> >>  	char digest[MAX_DIGEST_SIZE];
> >>  	unsigned char np;
> >>  	unsigned char tap[MAX_TAP];
> >> -	char key[128]; /* only used with keyed hash algorithms */
> >> +	char key[128] __attribute__((__aligned__(4))); /* only used with keyed hash algorithms */
> >>  	unsigned char ksize;
> >>  };
> >>  
> >> @@ -48,7 +48,7 @@ struct hmac_testvec {
> >>  struct cipher_testvec {
> >>  	unsigned char fail;
> >>  	unsigned char wk; /* weak key flag */
> >> -	char key[MAX_KEYLEN];
> >> +	char key[MAX_KEYLEN] __attribute__((__aligned__(4)));
> >>  	unsigned char klen;
> >>  	char iv[MAX_IVLEN];
> >>  	char input[48];
> >
> > Wouldn't it be better to simply move this to the head of the structure?
> 
> That wouldn't help, since the whole structure will still be only 8-bit
> aligned.

Ahh, hadn't noticed the struct was entirely populated by chars.

-- 
Mathematics is the supreme nostalgia of our time.

  reply	other threads:[~2006-03-11 23:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-08 14:11 Atsushi Nemoto
2006-03-11 23:12 ` Matt Mackall
2006-03-11 23:29   ` Andreas Schwab
2006-03-11 23:48     ` Matt Mackall [this message]
2006-03-13 10:43       ` 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=20060311234841.GI28168@waste.org \
    --to=mpm@selenic.com \
    --cc=akpm@osdl.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwab@suse.de \
    /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

all inboxes | Powered by JetHome®