ArticleslgStudy

science

Grain 128a

Grain 128a is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Grain 128a rather than just read about it. In short: 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 — main illustration
Grain 128a — illustration

Key takeaways

  • Grain 128a belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Grain 128a to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Grain 128a from memory before moving on to harder problems.

Reference excerpt

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.

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 0<w≤32. The cipher uses a 128 bit key. The cipher supports two modes of operation: with or without authentication, which is configured via the supplied IV0 such that if IV0=1 then authentication of the message is enabled, and if IV0=0 authentication of the message is disabled.

Pre-output function The pre-output function consists of two registers of size 128 bit: NLFSR (b) and LFSR (s) along with 2 feedback polynomials f and g and a boolean function h. f(x)=1+x32+x47+x58+x90+x121+x128 g(x)=1+x32+x37+x72+x102+x128+x44x60+x61x125+x63x67x69x101+x80x88+x110x111+x115x117+x46x50x58+x103x104x106+x33x35x36x40 h(x)=bi+12si+8+si+13si+20+bi+95si+42+si+60si+79+bi+12bi+95si+94 In addition to the feedback polynomials, the update functions for the NLFSR and the LFSR are: bi+128=si+bi+bi+26+bi+56+bi+91+bi+96+bi+3bi+67+bi+11bi+13+bi+17bi+18+bi+27bi+59+bi+40bi+48+bi+61bi+65+bi+68bi+84+bi+88bi+92bi+93bi+95+bi+22bi+24bi+25+bi+70bi+78bi+82 si+128=si+si+7+si+38+si+70+si+81+si+96 The pre-output stream (y) is defined as: yi=h(x)+si+93+bi+2+bi+15+bi+36+bi+45+bi+64+bi+73+bi+89

Initialisation

Upon initialisation we define an IV of 96 bit, where the IV0 dictates the mode of operation. The LFSR is initialised as: si=IVi for 0≤i≤95 si=1 for 96≤i≤126 s127=0 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 (k) into the NLFSR: bi=ki for 0≤i≤127

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 g and f.

Key stream The key stream (z) and MAC functionality in Grain 128a both share the same pre-output stream (y). As authentication is optional our key stream definition depends upon the IV0. When authentication is enabled, the MAC functionality uses the first 2w bits (where w 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. If authentication is enabled: zi=y2w+2i If authentication is disabled: zi=yi

MAC

Grain 128a supports tags of size w up to 32 bit, to do this 2 registers of size w is used, a shift register(r) and an accumulator(a). To create a tag of a message m where L is the length of m+1 as we have to set mL=1 to ensure that i.e. m1=1 and m2=10 has different tags, and also making it impossible to generate a tag that completely ignores the input from the shift register after initialisation. For each bit 0≤j≤31 in the accumulator we at time 0≤i≤L we denounce a bit in the accumulator as aij.

Initialisation When authentication is enabled Grain 128a uses the first 2w bits of the pre-output stream(y) to initialise the shift register and the accumulator. This is done by: Shift register: ri=yi+31 for 0≤i≤31 Accumulator: a0j=yj for 0≤j≤31

Tag generation Shift register: The shift register is fed all the odd bits of the pre-output stream(y): ri+31=y64+2i+1 Accumulator: ai+1j=aij+miri+j for 0≤i≤L

Final tag When the cipher has completed the L iterations the final tag(t) is the content of the accumulator: ti=aL+1i for 0≤i≤31

References

External links A New Version of Grain-128 with Authentication

Illustrations

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

Worked examples

Example 1 — a first encounter with Grain 128a

Start with the simplest possible case. Write down what Grain 128a claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Grain 128a before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Grain 128a ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Grain 128a

In research
Grain 128a appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Grain 128a in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Grain 128a is common in secondary-school and first-year university syllabi. It links to neighbouring topics Stream ciphers, so understanding it makes those chapters shorter.
In everyday life
Look for Grain 128a outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Grain 128a” →

How to study Grain 128a in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Grain 128a means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Grain 128a out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Grain 128a in simple terms?

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 fami…

Why does Grain 128a matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Grain 128a?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Grain 128a.

Tags

  • Stream ciphers

Keep exploring