5
$\begingroup$

I'm writing a school assignment and I'm trying to fully grasp the differences between Salsa20 and ChaCha.

I've come to understand that by rotating upwards the initial matrix columns, DJB says that thanks to SIMD each quarter-round will run in parallel for each column, effectively running four quarter-rounds at the same time.

But if the following round has to be run on diagonals how can this be optimized for SIMDs? Will it rotate again columns to make the diagonals into rows? Will this rotation affect performance or the benefit of the SIMD beats this?

$\endgroup$
  • $\begingroup$ Columns are easy to vectorize. Rows are harder. Diagonals are just a rotation followed by a column, so they're still pretty easy to vectorize and apparently faster than rows. I don't know enough about SIMD to make this a formal answer. $\endgroup$ – SAI Peregrinus Feb 6 '18 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.