Score:0

Understanding non-linearity in Salsa20 over various rings

ru flag

In his design of Salsa20, Bernstein writes to ensure non-linearity he chose

32-bit addition (breaking linearity over $Z/2$), 32-bit xor (breaking linearity over $Z/2^32), and constant-distance 32-bit rotation (diffusing changes from high bits to low bits).

Can you help me understand this? A linear function is one such that $f(ax+by) = af(x) + bf(y)$. It sounds like whether addition and xor are linear depends on which definition of addition and multiplication you are using, which depends on which ring you are using, but rotation is linear in any ring.

Also, $f$ takes one input, whereas 32 bit add or xor take two inputs, each of which is a portion of the 512 bit element. I assume a 2-ary function is linear if, fixing the first input makes a linear 1-ary function.

Score:2
my flag

It sounds like whether addition and xor are linear depends on which definition of addition and multiplication you are using, which depends on which ring you are using

That is quite correct; operations that are linear in one ring need not be linear in a different one.

but rotation is linear in any ring

Nope; rotation is not linear in the ring $\mathbb{Z}/{2^{32}}$

Here's an example: let $F(x)$ be $x$ rotated right one position.

Then, $F(1+1) = F(2) = 1$, however $F(1) + F(1) = 2^{31} + 2^{31} = 0$, hence $F$ is not linear.

I assume a 2-ary function is linear if, fixing the first input makes a linear 1-ary function.

No; if that were the case, then multiplication would be a linear operation (because if you fix one of the inputs, it is linear in the other).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.