What do we mean by

the Salsa core preserves diagonal shifts


1 Answer 1


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.

  • $\begingroup$ 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. $\endgroup$
    – BHARTI
    Oct 21, 2016 at 4:23
  • $\begingroup$ But in such case , the last row after shifting will be 0 $\endgroup$
    – BHARTI
    Oct 21, 2016 at 4:24
  • $\begingroup$ @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. $\endgroup$ Oct 21, 2016 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.