New answers tagged ctr
Your intuition is on the right track: if you run a pseudorandom function in counter mode with your secret key, you get a stream cipher. Some stream ciphers are designed like this, perhaps most notably Salsa20 (and its later variant ChaCha20). But the key to answering your question, as I see it, is to note that a collision-resistant hash function like SHA-2 ...
It is simply a parameter for indicating the length of the keystream in bits. Internally, EEA2 will call AES the appropriate number of times to produce that much output, truncating the last block as needed. It is not mixed into AES inputs or the key, so like you said it has no effect on the output bits themselves, beyond choosing how many are taken.
Top 50 recent answers are included