Grain-128aead
LFSR/NLFSR stream cipher with an integrated MAC; NIST LWC finalist
Experimental or unclassified. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About Grain-128aead
Grain-128aead is an authenticated encryption (AEAD) scheme. It uses a 16-byte (128-bit) key, a 12-byte nonce and an 8-byte (64-bit) authentication tag. Its registry entry cites Grain-128AEAD round-2 (v1) (NIST LWC). NextSSL lists it in the research tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
Grain-128AEAD is an authenticated stream cipher from the Grain family, combining a 128-bit LFSR and 128-bit NLFSR keystream generator with an accumulator-based MAC. It was a finalist in the NIST Lightweight Cryptography process.
The keystream generator produces two interleaved streams: even bits encrypt the plaintext and odd bits feed a shift-register-and-accumulator MAC that authenticates the data. This lets hardware implementations reach very small area while processing one or more bits per clock.
NextSSL includes the round 2 (v1) version with a 128-bit key, 96-bit nonce and 64-bit tag. A revised specification, Grain-128AEADv2, was published for the final round. The Grain family began with the eSTREAM portfolio cipher Grain v1, and Grain-128a added optional authentication before Grain-128AEAD was submitted to NIST.
History
2018–2025NIST calls for lightweight AEAD and hashing designs
NIST Lightweight Cryptography projectGrain-128AEAD published
56 round-1 candidates accepted; 32 advance to round 2 in August
NIST Lightweight Cryptography projectTen finalists announced
NIST Lightweight Cryptography projectAscon selected as the lightweight standard
NIST Lightweight Cryptography projectAscon published in NIST SP 800-232
NIST Lightweight Cryptography project
Security notes
Nonce reuse leaks plaintext and allows key-stream and state recovery. The 64-bit tag gives limited forgery resistance per attempt.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 16 | Secret key |
| nonce | 12 | Nonce / IV |
| tag | 8 | Authentication tag |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'research' is reachable from the root API only
key, nonce = root.random(16), root.random(12)
ct = root.call("aead_seal", "grain-128aead", None, key, nonce, b"header", b"secret")[0] # ct || tag
pt = root.call("aead_open", "grain-128aead", None, key, nonce, b"header", ct)[0]
nextssl_root_aead_seal("grain-128aead", NULL, key, nonce, aad, pt, out); /* writes ct || tag */
nextssl_root_aead_open("grain-128aead", NULL, key, nonce, aad, ct, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_aead_in(reg::all(), Policy::Any, "grain-128aead", &Params::new())?;
let ct = alg.seal(&key, &nonce, b"header", b"secret")?;
let pt = alg.open(&key, &nonce, b"header", &ct)?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Similar names
Looking for something else?More authenticated encryption
All 392Frequently asked questions
What is Grain-128aead?
Grain-128aead is an AEAD in the Grain-128AEAD family. Grain-128AEAD is an authenticated stream cipher from the Grain family, combining a 128-bit LFSR and 128-bit NLFSR keystream generator with an accumulator-based MAC.
What are the Grain-128aead sizes?
In NextSSL, Grain-128aead uses: key 16 bytes, nonce 12 bytes, tag 8 bytes.
Who designed Grain-128aead and when?
Grain-128aead belongs to the Grain-128AEAD family, first published in 2019 by Martin Hell, Thomas Johansson, Alexander Maximov, Willi Meier, Jonathan Sönnerup, Hirotaka Yoshida. Its origin: NIST LWC finalist.
Which standards define Grain-128aead?
Grain-128aead is referenced by Grain-128AEAD round-2 (v1) (NIST LWC).
Is Grain-128aead safe to use?
Grain-128aead is in the research tier. Experimental or unclassified. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).