In computer science and cryptography,
Whirlpool is a cryptographic hash
function. It was designed by Vincent
Rijmen and Paulo S. L. M. Barreto, who
first described it in 2000. The hash has
been recommended by the NESSIE project.
It has also been adopted by the
International Organization for
Standardization and the International
Electrotechnical Commission as part of
the joint ISO/IEC 10118-3 international
standard.
Design features 
Whirlpool is a hash designed after the
Square block cipher. Whirlpool is a
Miyaguchi-Preneel construction based on
a substantially modified Advanced
Encryption Standard. It takes a message
of any length less than 2256 bits and
returns a 512-bit message digest.
The authors have declared that
"WHIRLPOOL is not patented. It may be
used free of charge for any purpose."
= Version changes =
The original Whirlpool will be called
Whirlpool-0, the first revision of
Whirlpool will be called Whirlpool-T and
the latest version will be called
Whirlpool in the following test vectors.
In the first revision in 2001, the s-box
was changed from a randomly generated
one with good cryptographic properties
to one which has better cryptographic
properties and is easier to implement in
hardware.
In the second revision, a flaw in the
diffusion matrix was found that lowered
the estimated security of the algorithm
below its potential. Changing the 8x8
rotating matrix constants from to solved
this issue.
Internal structure 
The Whirlpool hash function is a
Merkle–Damgård construction based on an
AES-like block cipher W in
Miyaguchi-Preneel mode. The block cipher
W consists of an 8×8 state matrix  of
bytes, for a total of 512 bits. The
encryption process consists of updating
the state with four round functions over
10 rounds. The four round functions are
SubBytes, ShiftColumns, MixRows and
AddRoundKey. During each round the new
state is computed as .
= SubBytes =
The SubBytes operation applies a
non-linear permutation to each byte of
the state independently. The 8-bit S-box
is composed of 3 smaller 4-bit S-boxes.
= ShiftColumns =
The ShiftColumns operation cyclically
shifts each byte in each column of the
state. Column j has its bytes shifted
downwards by j positions.
= MixRows =
The MixRows operation is a
right-multiplication of each row by an
8×8 matrix over . The matrix is chosen
such that the branch number is 9, which
is maximal.
= AddRoundKey =
The AddRoundKey operation uses bitwise
xor to add a key calculated by the key
schedule to the current state. The key
schedule is identical to the encryption
itself, except the AddRoundKey function
is replaced by an AddRoundConstant
function that adds a predetermined
constant in each round.
Whirlpool hashes 
The Whirlpool algorithm has undergone
two revisions since its original 2000
specification.
People incorporating Whirlpool will most
likely use the most recent revision of
Whirlpool; while there are no known
security weaknesses in earlier versions
of Whirlpool, the most recent revision
has better hardware implementation
efficiency characteristics, and is also
likely to be more secure. As mentioned
earlier, it is also the version adopted
in the ISO/IEC 10118-3 international
standard.
The 512-bit Whirlpool hashes are
typically represented as 128-digit
hexadecimal numbers. The following
demonstrates a 43-byte ASCII input and
the corresponding Whirlpool hashes:
Whirlpool-0("The quick brown fox jumps
over the lazy dog") =
D133792CCFA501FD8DA53EE368FED20E5FE0248C
3A8DDEC791FF05FEE6D971D57C1348320F4EB42D
Whirlpool-T("The quick brown fox jumps
over the lazy dog") =
99C06EE38E67CB546CFFCF48E91F700F6FC7C183
20A1E3A20D79CD5168544D9E1B7CDF49970E87F1
Whirlpool("The quick brown fox jumps
over the lazy dog") =
DCE9CEB3C4A71F9BEA8D88E75C4FA854DF36725F
FEA403CB55AE31F03AD62A5EF54E42EE82C3FB35
Even a small change in the message will
result in a different hash, which will
usually look completely different just
like two unrelated random numbers do.
The following demonstrates the result of
changing the previous input by a single
letter, replacing d with e:
Whirlpool-0("The quick brown fox jumps
over the lazy eog") =
836A12B7D7F2A0803E43DABA0C7FC38BC11C8F2A
565A64AC50C26179164B26084A253CAF2E012676
Whirlpool-T("The quick brown fox jumps
over the lazy eog") =
9B8A9139746DA299AD50158F5FA9EECDDEF744F9
E964C2959C507AB2DB0F1F3BF3E3B299CA00CAE3
Whirlpool("The quick brown fox jumps
over the lazy eog") =
834F925CC666D0974167AF915BB462420ED40CC5
50492D5C143011A76988344C2635E69D06F2D38C
The hash of a zero-length string is:
Whirlpool-0("") =
2074416ACCD3B8E62C620175FCA0997B1BA23473
11DFA40C1C32F1A2B9004725D987D3635165D3C8
Whirlpool-T("") =
BE12A14387CEDBD10DD17B8243CAD550A089DC0F
76E43C7CFCA0AD32567897DCB5969861049A0F5A
Whirlpool("") =
1D2E1726C530232130D407F89AFEE0964997F7A7
3C4F0757EA8964E59B63D93708B138CC42A66EB3
Implementations 
The authors provide reference
implementations of the WHIRLPOOL
algorithm, including a version written
in C and a version written in Java.
These reference implementations have
been released into the public domain.
Two of the first widely used mainstream
cryptographic programs that started
using Whirlpool were FreeOTFE, followed
by TrueCrypt in 2005.
See also 
Digital timestamping
Hashcash
References 
^ Florian Mendel1, Christian Rechberger,
Martin Schläffer, Søren S. Thomsen.
"Cryptanalysis of Reduced Whirlpool and
Grøstl". Fast Software Encryption: 16th
International Workshop. 
^ a b c d e "The Whirlpool Hash
Function". Retrieved 20 December 2011. 
^ Barreto, Paulo S.L.M. and Rijmen,
Vincent. "The WHIRLPOOL Hashing
Function". Retrieved 2009-08-01. 
^ Kyoji, Shibutani and Shirai, Taizo.
"On the diffusion matrix employed in the
Whirlpool hashing function". Retrieved
2007-11-21. 
External links 
Whirlpool homepage Includes detailed
algorithm information, C and Java
implementations, the paper, etc.
A Java implementation of all three
revisions of Whirlpool
An open source Go implementation of the
latest revision of Whirlpool
A Matlab Implementation of the Whirlpool
Hashing Function
CHK Freeware Checksum Utility with GUI
and WHIRLPOOL support
RHash, an open source command-line tool,
which can calculate and verify Whirlpool
hash.
Perl Whirlpool module at CPAN
Ruby Whirlpool library
Ironclad: a Common Lisp cryptography
package containing a Whirlpool
implementation
The ISO/IEC 10118-3 standard
Test vectors for the Whirlpool hash from
the NESSIE project
Managed C# implementation
