This file is a python port of Whirlpool.c the reference implementation:
http://www.larc.usp.br/~pbarreto/whirlpool.zip
Comparison of both implementations reveals a difference in loop logic
at the very beginning of the WhirlpoolAdd function, which is fixed now.
carry = 0
value = sourceBits
i = 31
- while i >= 0 and value != 0:
+ while i >= 0 and (carry != 0 or value != 0):
carry += ctx.bitLength[i] + ((value % 0x100000000) & 0xff)
ctx.bitLength[i] = carry % 0x100
carry >>= 8