2.3 Ciphertext decryption
The generation of the 40 sub keys used for ciphertext decryption is the same as the generation method for the 40 subkeys in plaintext encryption.
2.3.1 First step forward mixing
The input 128-bit ciphertext is divided into four d[0],d[1],d[2],d[3], and the last four of the 40 keys generated are selected to be added to the four pieces of data respectively.
D[0] + = k[36];
D[1] + = k[37];
D[2] + = k[38];
D[3] + = k[39];
Results as input data for the first-round operation.
First round:
D[0] |
D[1] |
D[2] |
D[3] |
B0 |
B1 |
B2 |
B3 |
Firsttarget |
Secondtarget |
Thirdtarget |
Combine d[0],d[1],d[2],d[3] into 128-bit data, loop left 32 bits into four blocks d[0],d[1],d[2],d[3] where d[0] as source data, the remaining 3 as the target data, the D[0 Loop right 24-bit results back to d[0]
32-bit source data d[0] into 8-bit four B0,B1,B2,B3
|
B0 |
B1 |
B2 |
B3 |
Firsttarget |
Secondtarget |
Thirdtarget |
Before moving |
D[0] |
D[1] |
D[2] |
D[3] |
After moving |
D[1] |
D[2] |
D[3] |
D[0] |
B0 and B2 as array subscripts look for S-box replacements from S1: S1[b0],s1[b2]
B1 and B3 as array subscripts look for S-box replacements from S0: S0[b1],s0[b3]
Actions on Firsttarget:
Firsttarget the result of a bitwise XOR or S1[B0] return to Firsttarget
Actions on Secondtarget:
Secondtarget plus S0[B3] Returns the result to Secondtarget
Actions on Thirdtarget:
Thirdtarget is returned to thirdtarget with the result of a bitwise XOR or S0[B1] plus s1[b2].
This step is carried out in a total of 8 rounds, Add the action at the end of the first and fifth rounds to return the result of source plus firsttarget to source. Add the action at the end of the second and sixth rounds to return the result of source plus thirdtarget to source