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)
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
This is fixed in git: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3596fc3822bb82dfe05a58fdb78220e399175a4d
This is in 2.2.0_alpha91, but I'll leave this bug open until it's in an unmasked release.
This is fixed in 2.1.10.50.