lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 08 Jun 2014 13:26:35 -0700
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	George Spelvin <linux@...izon.com>, dborkman@...hat.com
Cc:	davem@...emloft.net, linux-kernel@...r.kernel.org,
	shemminger@...l.org, tytso@....edu
Subject: Re: [PATCH 4/7] lib/random32.c: Use <asm/unaligned.h> instead of
 hand-rolling it

On Sun, Jun 8, 2014, at 5:40, George Spelvin wrote:
> > Seems fine by me, since it's random anyway archs might not care
> > about the *_le32, though this might yield additional work in some
> > cases I presume.
> 
> If you think that's okay, sure.  I kept it consistent to get byte-for-byte
> identical results.
> 
> If variations in that are allowed, that can also
> simplify the trailing storage case:
> 
> +		if (bytes & 2)
> +			put_unaligned_le16((u16)random, p+i);
> +		if (bytes & 1)
> +			p[i+bytes-1] = (u8)(random >> 16);

Yes, please! Otherwise the code looks much too complicated for what it does.

> > Nit: '(u8) random'
> 
> Actually, my style and most of the kerel is to not put
> a space in a cast, since it binds so tighty.
> 
> E.g. compare
> 
> git grep ')[a-z]' kernel/
> git grep ') [a-z]' kernel/
> 
> Notice that the second is alsmost all comments.
> (There are some spaces in kernel/ptrace.v.)
> 
> I'd rather leave it without the space unless you feel
> very strongly about it.

IMHO I wouldn't put a whitespace here.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ