![]() | ||
The Grain 128a stream cipher was first purposed at Symmetric Key Encryption Workshop (SKEW) in 2011 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, Martin Hell, Thomas Johansson and Willi Meier.
Contents
Description of the cipher
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 supports two modes of operation: with or without authentication, which is configured via the supplied
Pre-output function
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:
The pre-output stream (
Initialisation
Upon initialisation we define an
The LFSR is initialised as:
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 (
Start up clocking
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
Key stream
The key stream (
When authentication is enabled, the MAC functionality uses the first
If authentication is enabled:
If authentication is disabled:
MAC
Grain 128a supports tags of size
For each bit
Initialisation
When authentication is enabled Grain 128a uses the first
Shift register:
Accumulator:
Tag generation
Shift register:
The shift register is fed all the odd bits of the pre-output stream(
Accumulator:
Final tag
When the cipher has completed the L iterations the final tag(