RIPEMD-160 Compression
Initialisation of Working Variables
The first step is to initialise our working variables. RIPEMD-160 runs the same message schedule through two different computation paths in parallel. Each side of the function uses 5 working variables. Both sides use the same initial values to initialise their working variables. The initial values are given in Dobbertin et al's paper [^1].
Note: If the message block is larger than 512 bits -- meaning there will be more than one round of compression, only the first round uses the initial values. Each subsequent call of the compression function uses the chaining variables computed and returned from the previous function call.
Mutation and Compression of Message Schedule
Now we're into the fun part of the RIPEMD-160 hash function!
RIPEMD-160's compression process uses 5 rounds of 16 steps for 80 steps in total.
Each of the 5 rounds consists of a temporary word computed for each side of the algorithm using a logical function and left bit rotations using a given value schedule provided in Dobbertin et al's paper [^1]. After the temporary word has been computed, the working variables are mutated with d, dd (i.e. d prime), b, and bb (i.e. b prime) being computed with a left rotation by 10 and the inclusion of the temporary word, respectively.
Computing Chained Variables
The last subsection of RIPEMD-160's compression function is the computation of the chaining variables. Note, if there are no more 512-bit blocks left to compress, i.e. it's the final round of compression, the chaining variables that are returned are the final values of the hash function.
Chaining variable computation consists of adding the two sides of the compression function together with the initial values given for the current round of compression:
Once the chaining values have been calculated, they're returned, and the compression round is complete.
Last updated
Was this helpful?

