# The Salsa20 core preserves diagonal shifts?

What do we mean by

the Salsa core preserves diagonal shifts

The input of the Salsa20 core is a 4x4 array of 32-bit words. If you move all the inputs diagonally (wrapping), the output will be the same as the original output, except that it's moved by the same offset.

$P^\prime_{i,j}=P_{i+k,j+k}$ implies $C^\prime_{i,j}=C_{i+k,j+k}$ (indices reduced modulo 4)

This symmetry follows directly from Salsa20 applying the same operations to all columns and all rows.

The full Salsa20 uses four fixed input words, which ensures that no matter how you choose the remaining inputs, you can never find two different inputs which could be transformed into each other using such a diagonal shift.

• Is it like shifting 1st row by 32 bit right,2nd row by 64 bits,3rd row by 96 bits and fourth row by 128 bits. – BHARTI Oct 21 '16 at 4:23
• But in such case , the last row after shifting will be 0 – BHARTI Oct 21 '16 at 4:24
• @BHARTI No, it's replacing the full contents of the words. The second row contains what was in the first row before and the second column contains what was in the first column. The values inside the words remain the same. This is unrelated to bit-shifting. – CodesInChaos Oct 21 '16 at 7:11