Starting stream cypher, first block (Salsa20) I'm implementing Salsa20 in Rust for fun.

I have the initial state (4x4 32-bit matrix) setup from the key, nonce, and stream position 0. I'm using the Wikipedia Salsa20 article as reference, and I'm confused on how to encrypt the first block. QR is applied on the 4x4 matrix, but how do I "mix in" the input? Is there a better reference for this algorithm (or stream ciphers in general) I could use to understand the implementation?
I suggest you take a look at the spec of Salsa20. It is quite short and easy to understand. You even have some examples for each component of the implementation.



For more details, you can take a look at this post which explains how to handle different key size (how to treat your initial block, and feed it to the Salsa hash function).