Grain 128a

The Grain 128a stream cipher was first purposed at Symmetric Key Encryption Workshop (SKEW) in 2011[1] as an improvement of the predecessor Grain 128, which added security enhancements and optional message authentication using the Encrypt & MAC approach.

One of the important features of the Grain family is that the throughput can be increased at the expense of additional hardware.

Grain 128a is designed by Martin Ågren,[1] Martin Hell, Thomas Johansson and Willi Meier.

Grain 128a consists of two large parts: Pre-output function and MAC.

The pre-output function has an internal state size of 256 bits, consisting of two registers of size 128 bit: NLFSR and LFSR.

The MAC supports variable tag lengths w such that

The cipher uses a 128 bit key.

The cipher supports two modes of operation: with or without authentication, which is configured via the supplied

then authentication of the message is enabled, and if

authentication of the message is disabled.

The pre-output function consists of two registers of size 128 bit: NLFSR (

In addition to the feedback polynomials, the update functions for the NLFSR and the LFSR are:

dictates the mode of operation.

The last 0 bit ensures that similar key-IV pairs do not produce shifted versions of each other.

The NLFSR is initialised by copying the entire 128 bit key (

Before the pre-output function can begin to output its pre-output stream it has to be clocked 256 times to warm up, during this stage the pre-output stream is fed into the feedback polynomials

) and MAC functionality in Grain 128a both share the same pre-output stream (

As authentication is optional our key stream definition depends upon the

When authentication is enabled, the MAC functionality uses the first

is the tag size) after the start up clocking to initialise.

The key stream is then assigned every other bit due to the shared pre-output stream.

Grain 128a supports tags of size

To create a tag of a message

has different tags, and also making it impossible to generate a tag that completely ignores the input from the shift register after initialisation.

we denounce a bit in the accumulator as

When authentication is enabled Grain 128a uses the first

bits of the pre-output stream(

) to initialise the shift register and the accumulator.

Shift register: The shift register is fed all the odd bits of the pre-output stream(

When the cipher has completed the L iterations the final tag(

View of grain 128a
Diagram showing the start up procedure of the pre-output which feeds the pre-output stream back into the functions and
View of grain 128a