Authenticated encryption

Grain128aeadv2

A stream-cipher-based AEAD from the Grain family, with a 96-bit IV and 64-bit tag

unverified Root API only
Unverified tier.

Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.

About Grain128aeadv2

Grain128aeadv2 is an authenticated encryption (AEAD) scheme from the Grain-128AEAD family. It uses a 16-byte (128-bit) key, a 12-byte nonce and an 8-byte (64-bit) authentication tag. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).

Overview

Grain-128AEAD is an authenticated encryption design from the Grain stream cipher family, using a 16-byte key, a 12-byte nonce and an 8-byte tag. It was submitted to the NIST Lightweight Cryptography process. NextSSL carries the second version as an unverified variant.

Grain-128AEAD extends the Grain stream cipher family with message authentication. Its state combines a linear and a nonlinear feedback shift register with an accumulator that produces the tag, so the same compact hardware structure that makes Grain attractive also generates authentication.

NextSSL carries the variant grain128aeadv2 with a 16-byte key, a 12-byte nonce and an 8-byte tag. The 8-byte tag gives roughly 64-bit forgery resistance, which is short for general use. The design was aimed at very constrained hardware, and the archive records it as unverified.

Its design is closely related to the Grain-128 stream cipher, which is also in the archive under the grain entry, so cryptanalysis of the base cipher is relevant background for this variant.

History

2018–2025
  1. NIST calls for lightweight AEAD and hashing designs

    NIST Lightweight Cryptography project
  2. Grain-128AEAD published by Martin Hell, Thomas Johansson, Alexander Maximov, Willi Meier

  3. 56 round-1 candidates accepted; 32 advance to round 2 in August

    NIST Lightweight Cryptography project
  4. Ten finalists announced

    NIST Lightweight Cryptography project
  5. Ascon selected as the lightweight standard

    NIST Lightweight Cryptography project
  6. Ascon published in NIST SP 800-232

    NIST Lightweight Cryptography project

How it works

  1. The 16-byte key and 12-byte nonce load the two shift registers.
  2. A warm-up phase mixes the state before any output is used.
  3. Plaintext is encrypted by XOR with keystream while the authentication part updates an accumulator, producing the 8-byte tag.

Security notes

Unverified in NextSSL. Designs in the Grain family have a published cryptanalysis history, so the unverified tier is a reason for caution. The 8-byte tag limits forgery resistance.

Typical uses

Constrained hardware where a stream-cipher AEAD is preferredResearch into hybrid stream cipher and MAC designsComparing NLFSR-based AEADs with sponge and block-cipher AEADs

Sizes

FieldBytesMeaning
key16Secret key
nonce12Nonce / IV
tag8Authentication tag

Use it

from nextssl_demo import NextSSL

root = NextSSL(root=True)   # tier 'unverified' is reachable from the root API only
key, nonce = root.random(16), root.random(12)
ct = root.call("aead_seal", "grain128aeadv2", None, key, nonce, b"header", b"secret")[0]   # ct || tag
pt = root.call("aead_open", "grain128aeadv2", None, key, nonce, b"header", ct)[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently asked questions

What is Grain128aeadv2?

Grain128aeadv2 is an AEAD in the Grain-128AEAD family. Grain-128AEAD is an authenticated encryption design from the Grain stream cipher family, using a 16-byte key, a 12-byte nonce and an 8-byte tag.

What are the Grain128aeadv2 sizes?

In NextSSL, Grain128aeadv2 uses: key 16 bytes, nonce 12 bytes, tag 8 bytes.

Who designed Grain128aeadv2 and when?

Grain128aeadv2 belongs to the Grain-128AEAD family, first published in 2019 by Martin Hell, Thomas Johansson, Alexander Maximov, Willi Meier. Its origin: NIST Lightweight Cryptography submission.

Is Grain128aeadv2 safe to use?

Grain128aeadv2 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).