The test vectors listed in


Are represented as Hex strings? I'm sure that the key is, because it's length is 32. And each hex digit, nibble, is 4 bits. So 32x4=128. But what about the stream generated? How are they represented?


Yes. The stream is also in hexadecimal, as is the IV if used.

The representation is just the output stream broken into 64-byte sections. Some of the tests output 512 bytes of stream, some output 131072.

  • $\begingroup$ Thanks Richie. But There has to be some difference. The length of the Key is 32 hex (wich is 128 bits). But the length of the stream is 512 (32 x 16). But in the beginning it says "stream is generated by encrypting 512 zero bytes". I believed that the stream is generated first and every bit of that stream is XORed with the 512 zero message". It should say bits, not bytes, right? $\endgroup$ – Mark Nov 14 '15 at 22:54
  • $\begingroup$ The Key is 32 (hex) x4 = 128 bits (because each hex represents 4 bits, a nibble). Applying the same logic to the generated key stream 32 (hex) x 16 (rows) = 512 hex x 4 = 2048 bits. $\endgroup$ – Mark Nov 15 '15 at 0:22
  • $\begingroup$ @Mark Yes, but the key stream is broken up in blocks because the blocks are not successive. Take a good look at the start / end of the blocks. You are right about the key of course. $\endgroup$ – Maarten Bodewes Nov 15 '15 at 0:26
  • $\begingroup$ You're right Maarten! The blocks are not succesive. For example, the first block is stream[0..63] which cardinal is 64. The result is a 128 hex x 4 = 512 bits (per block). As the block has 64 elements, 512/64 = 8. Hence, each element of the block is a byte. Am I correct now? Thanks $\endgroup$ – Mark Nov 15 '15 at 1:01
  • $\begingroup$ @Mark each 2-octet element of the block is a byte, yes. $\endgroup$ – Richie Frame Nov 16 '15 at 6:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.