Trivium (cipher) - Specification

Specification

Trivium may be specified very concisely using three recursive equations. Each variable is an element of GF(2); they can be represented as bits, with "+" being XOR and "•" being AND.

  • ai = ci−66 + ci−111 + ci−110ci−109 + ai−69
  • bi = ai−66 + ai−93 + ai−92ai−91 + bi−78
  • ci = bi−69 + bi−84 + bi−83bi−82 + ci−87

The output bits r0 ... r264−1 are then generated by

  • ri = ci−66 + ci−111 + ai−66 + ai−93 + bi−69 + bi−84

Given an 80-bit key k0 ... k79 and an l-bit IV v0 ... vl−1 (where 0 ≤ l ≤ 80), Trivium is initialized as follows:

  • (a−1245 ... a−1153) = (0, 0 ... 0, k0 ... k79)
  • (b−1236 ... b−1153) = (0, 0 ... 0, v0 ... vl−1)
  • (c−1263 ... c−1153) = (1, 1, 1, 0, 0 ... 0)

The large negative indices on the initial values reflect the 1152 steps that must take place before output is produced.

To map a stream of bits r to a stream of bytes R, we use the little-endian mapping Ri = Σj=0 ... 7 2j r8i+j.

Read more about this topic:  Trivium (cipher)