Re: [PATCH] sha512: replace open-coded be64 conversions

From: Jesper Juhl
Date: Tue Apr 19 2005 - 09:44:26 EST


On Tue, 19 Apr 2005, Denis Vlasenko wrote:

> On Tuesday 19 April 2005 12:04, Jesper Juhl wrote:
> > On Tue, 19 Apr 2005, Denis Vlasenko wrote:
> >
> > > This + next patch were "modprobe tcrypt" tested.
> > > See next mail.
> >
> > Could you please send patches inline instead of as attachments.
> > Attachments mean there's more work involved in getting at them to read
> > them, and they are a pain when you want to reply and quote the patch to
> > comment on it.
> > Thanks.
>
> I'm afraid Kmail tend to subtly mangle inlined patches.
> Then people start to complain that patch does not apply, and rightly so. :(
>
> However, I can try.
>
Thanks.

A few small comments below.


[...]
> @@ -483,12 +483,8 @@ static int anubis_setkey(void *ctx_arg,
> ctx->R = R = 8 + N;
>
> /* * map cipher key to initial key state (mu): */
> - for (i = 0, pos = 0; i < N; i++, pos += 4) {
> - kappa[i] =
> - (in_key[pos ] << 24) ^
> - (in_key[pos + 1] << 16) ^
> - (in_key[pos + 2] << 8) ^
> - (in_key[pos + 3] );
> + for (i = 0; i < N; i++) {
> + kappa[i] = be32_to_cpu( ((__be32*)in_key)[i] );
^^^^^^^ ^
is this cast really nessesary ? No space there.
> }
^
Those braces are superfluous.

[...]


Same comments for the rest of it. There seems to be a lot of unneeded
casts (I could be wrong, but I don't see the need for them, and if they
are not needed all they do is mask potential type errors). And the
whitespace thing also goes for the rest, don't put extra spaces after the
opening parenthesis and before the closing one in function calls.


--
Jesper Juhl


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/