Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 406407

Summary: sys-apps/portage-2.1.10.49: internal version of whirlpool algorithm generates wrong hash
Product: Portage Development Reporter: Kacper Kowalik (Xarthisius) (RETIRED) <xarthisius>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 409383    

Description Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2012-03-01 10:58:38 UTC
Reference:
$ openssl dgst -whirlpool /dev/shm/gsl-1.15.tar.gz 
whirlpool(/dev/shm/gsl-1.15.tar.gz)= 06ffffb83ea56cf6306878063770a117e096352dda3c3dd4a7526153bc770969f61e38fa08c02ec01335bd812581db15e4e5164a7da2363741179268cb393478

Portage using whirlpool from hashlib:
>>> from portage import checksum
>>> print checksum.perform_checksum('/dev/shm/gsl-1.15.tar.gz','WHIRLPOOL')
('06ffffb83ea56cf6306878063770a117e096352dda3c3dd4a7526153bc770969f61e38fa08c02ec01335bd812581db15e4e5164a7da2363741179268cb393478', 3281134)

Portage using internal implementation:
>>> from portage import checksum
>>> print checksum.perform_checksum('/dev/shm/gsl-1.15.tar.gz','WHIRLPOOL')
('ad3e80e8bc59df87b9b9e5fad15719ec7e965bcc2699a3fe9b6706b6dd9eca6fb234b18330ad22880cfb8d099010bd8ee61c373def4ce84bfe6a9cc995a53bdb', 3281134)
Comment 1 Zac Medico gentoo-dev 2012-03-01 12:10:44 UTC
It gets the correct result if the entire file content is passed to the update method in one big hunk. I guess I'll go through the code and compare it to whirlpool.c from the reference implementation (assuming it gets the same result as openssl):

  http://www.larc.usp.br/~pbarreto/whirlpool.zip
Comment 3 Zac Medico gentoo-dev 2012-03-18 00:20:15 UTC
This is in 2.2.0_alpha91, but I'll leave this bug open until it's in an unmasked release.
Comment 4 Zac Medico gentoo-dev 2012-03-23 00:54:19 UTC
This is fixed in 2.1.10.50.