Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 406407 - sys-apps/portage-2.1.10.49: internal version of whirlpool algorithm generates wrong hash
Summary: sys-apps/portage-2.1.10.49: internal version of whirlpool algorithm generates...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 409383
  Show dependency tree
 
Reported: 2012-03-01 10:58 UTC by Kacper Kowalik (Xarthisius) (RETIRED)
Modified: 2012-06-25 18:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.