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]
Message-ID: <4FFC2F95.7080003@msgid.tls.msk.ru>
Date:	Tue, 10 Jul 2012 17:35:17 +0400
From:	Michael Tokarev <mjt@....msk.ru>
To:	Andrew Hunter <ahh@...gle.com>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] core-kernel: use multiply instead of shifts in hash_64

On 03.07.2012 00:25, Andrew Hunter wrote:
> diff --git a/include/linux/hash.h b/include/linux/hash.h
> index b80506b..daabc3d 100644
> --- a/include/linux/hash.h
> +++ b/include/linux/hash.h
> @@ -34,7 +34,9 @@
>  static inline u64 hash_64(u64 val, unsigned int bits)
>  {
>  	u64 hash = val;
> -
> +#if BITS_PER_LONG == 64
> +	hash *= GOLDEN_RATIO_PRIME_64;
> +#else
>  	/*  Sigh, gcc can't optimise this alone like it does for 32 bits. */

Hmm.  Does this comment make sense here now?

Thanks,

/mjt
--
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