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.