# Test vectors representation

The test vectors listed in

https://github.com/cantora/avr-crypto-lib/blob/master/testvectors/Mickey-v2-128-unverified.test-vectors

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?

## 1 Answer

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.

• 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? – Mark Nov 14 '15 at 22:54
• 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. – Mark Nov 15 '15 at 0:22
• @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. – Maarten Bodewes Nov 15 '15 at 0:26
• 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 – Mark Nov 15 '15 at 1:01
• @Mark each 2-octet element of the block is a byte, yes. – Richie Frame Nov 16 '15 at 6:20