From: Andreas Schwab <schwab@suse.de>
To: Matt Mackall <mpm@selenic.com>
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: Sun, 12 Mar 2006 00:29:07 +0100 [thread overview]
Message-ID: <jeirqktvb0.fsf@sykes.suse.de> (raw)
In-Reply-To: <20060311231238.GJ7110@waste.org> (Matt Mackall's message of "Sat, 11 Mar 2006 17:12:38 -0600")
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.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2006-03-11 23:29 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 [this message]
2006-03-11 23:48 ` Matt Mackall
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=jeirqktvb0.fsf@sykes.suse.de \
--to=schwab@suse.de \
--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=mpm@selenic.com \
/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®