From: Herbert Xu <herbert@gondor.apana.org.au>
To: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
akpm@osdl.org
Subject: Re: [PATCH] crypto: fix unaligned access in khazad module
Date: Fri, 10 Mar 2006 09:10:30 +1100 [thread overview]
Message-ID: <20060309221030.GA11608@gondor.apana.org.au> (raw)
In-Reply-To: <20060309.122638.07642914.nemoto@toshiba-tops.co.jp>
On Thu, Mar 09, 2006 at 12:26:38PM +0900, Atsushi Nemoto wrote:
>
> - K2 = be64_to_cpu(key[0]);
> - K1 = be64_to_cpu(key[1]);
> + K2 = be64_to_cpu(get_unaligned(&key[0]));
> + K1 = be64_to_cpu(get_unaligned(&key[1]));
How about doing two 32-bit reads:
const __be32 *key = (const __be32 *)in_key;
K2 = ((u64)be32_to_cpu(key[0])) << 32 + be32_to_cpu(key[1]);
K1 = ((u64)be32_to_cpu(key[2])) << 32 + be32_to_cpu(key[3]);
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2006-03-09 22:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-09 3:26 Atsushi Nemoto
2006-03-09 22:10 ` Herbert Xu [this message]
2006-04-03 15:05 ` Atsushi Nemoto
2006-04-03 23:11 ` Herbert Xu
2006-04-04 7:55 ` Atsushi Nemoto
2006-04-05 17:29 ` 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=20060309221030.GA11608@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=akpm@osdl.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nemoto@toshiba-tops.co.jp \
/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®