Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-portage-dev
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-portage-dev@g.o
From: Brian Harring <ferringb@...>
Subject: Re: [GLEP59v2 2/5] Manifest2 hash: Whirlpool
Date: Sat, 1 Oct 2011 02:41:13 -0700
On Sat, Oct 01, 2011 at 07:40:52AM +0000, Robin H. Johnson wrote:
> From: "Robin H. Johnson" <robbat2@g.o>
> 
> Provide public-domain implementation of the Whirlpool hash algorithm to
> be used as new Manifest2 hash.
> 
> Signed-off-by: Robin H. Johnson <robbat2@g.o>
> ---
>  pym/portage/checksum.py |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
> index e5455fa..3593686 100644
> --- a/pym/portage/checksum.py
> +++ b/pym/portage/checksum.py
> @@ -71,6 +71,10 @@ except ImportError:
>  
>  sha1hash = _generate_hash_function("SHA1", _new_sha1, origin="internal")
>  
> +# Bundled WHIRLPOOL implementation
> +from portage.util.whirlpool import new as _new_whirlpool
> +whirlpoolhash = _generate_hash_function("WHIRLPOOL", _new_whirlpool, origin="bundled")
> +

Likely should shift this to a trailing check if no whirlpool 
implementation was found; via this, we can avoid the import unless 
it's needed.
~brian

>  # Use pycrypto when available, prefer it over the internal fallbacks
>  try:
>  	from Crypto.Hash import SHA256, RIPEMD
> @@ -80,14 +84,14 @@ except ImportError as e:
>  	pass
>  
>  # Use hashlib from python-2.5 if available and prefer it over pycrypto and internal fallbacks.
> -# Need special handling for RMD160 as it may not always be provided by hashlib.
> +# Need special handling for RMD160/WHIRLPOOL as they may not always be provided by hashlib.
>  try:
>  	import hashlib, functools
>  	
>  	md5hash = _generate_hash_function("MD5", hashlib.md5, origin="hashlib")
>  	sha1hash = _generate_hash_function("SHA1", hashlib.sha1, origin="hashlib")
>  	sha256hash = _generate_hash_function("SHA256", hashlib.sha256, origin="hashlib")
> -	for local_name, hash_name in (("rmd160", "ripemd160"), ):
> +	for local_name, hash_name in (("rmd160", "ripemd160"), ("whirlpool", "whirlpool")):
>  		try:
>  			hashlib.new(hash_name)
>  		except ValueError:
> -- 
> 1.7.7
> 


Replies:
Re: [GLEP59v2 2/5] Manifest2 hash: Whirlpool
-- Zac Medico
References:
[GLEP59v2 0/5] GLEP59: Manifest2 hash types
-- Robin H. Johnson
[GLEP59v2 2/5] Manifest2 hash: Whirlpool
-- Robin H. Johnson
Navigation:
Lists: gentoo-portage-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
[GLEP59v2 2/5] Manifest2 hash: Whirlpool
Next by thread:
Re: [GLEP59v2 2/5] Manifest2 hash: Whirlpool
Previous by date:
[GLEP59v2 1/5] Refactor RMD160 hashlib code for less-hardcoding
Next by date:
Re: [PATCH 1/4] Manifest2 hash: Whirlpool


Updated Jun 13, 2012

Summary: Archive of the gentoo-portage-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.