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 12:36:05 +0200
From:	Daniel Borkmann <dborkman@...hat.com>
To:	George Spelvin <linux@...izon.com>
CC:	davem@...emloft.net, shemminger@...l.org, tytso@....edu,
	linux-kernel@...r.kernel.org, hannes@...essinduktion.org
Subject: Re: [PATCH 7/7] lib/random32.c: Remove redundant U suffixes on integers

[ Please also Cc Hannes in your series. ]

On 06/07/2014 10:31 AM, George Spelvin wrote:
> Get rid of a few of the extraneous U suffixes on ordinary integers.
>
> Signed-off-by: George Spelvin <linux@...izon.com>
> ---
>   lib/random32.c | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/lib/random32.c b/lib/random32.c
> index 9cc410dd..ad0c2ed1 100644
> --- a/lib/random32.c
> +++ b/lib/random32.c
> @@ -58,10 +58,10 @@ u32 prandom_u32_state(struct rnd_state *state)
>   {
>   #define TAUSWORTHE(s,a,b,c,d) ((s&c)<<d) ^ (((s <<a) ^ s)>>b)
>
> -	state->s1 = TAUSWORTHE(state->s1,  6U, 13U, 4294967294U, 18U);
> -	state->s2 = TAUSWORTHE(state->s2,  2U, 27U, 4294967288U,  2U);
> -	state->s3 = TAUSWORTHE(state->s3, 13U, 21U, 4294967280U,  7U);
> -	state->s4 = TAUSWORTHE(state->s4,  3U, 12U, 4294967168U, 13U);
> +	state->s1 = TAUSWORTHE(state->s1,  6, 13, 4294967294U, 18);
> +	state->s2 = TAUSWORTHE(state->s2,  2, 27, 4294967288U,  2);
> +	state->s3 = TAUSWORTHE(state->s3, 13, 21, 4294967280U,  7);
> +	state->s4 = TAUSWORTHE(state->s4,  3, 12, 4294967168U, 13);

I don't see the point in why we _need_ to change this here.

>   	return (state->s1 ^ state->s2 ^ state->s3 ^ state->s4);
>   }
> @@ -77,9 +77,8 @@ EXPORT_SYMBOL(prandom_u32_state);
>   u32 prandom_u32(void)
>   {
>   	struct rnd_state *state = &get_cpu_var(net_rand_state);
> -	u32 res;
> +	u32 res = prandom_u32_state(state);
>
> -	res = prandom_u32_state(state);
>   	put_cpu_var(state);

Ditto.

>   	return res;
>
--
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