QARMA Explained: 5 Facts About the Tweakable Cipher

QARMA explained in plain terms means understanding the tweakable block cipher that guards the pointers inside your phone, a design from 2016 that adds a third input, the tweak, to the usual key and plaintext. The central question is why a cipher would need a tweak when a key already selects the encryption, and the answer is that a tweak lets one key encrypt many things differently without rekeying, so memory encryption and pointer signing become cheap, and that flexibility is the whole point of the design.

QARMA is a family of lightweight tweakable block ciphers designed by Roberto Avanzi at Qualcomm, published in 2016 and in the IACR Transactions on Symmetric Cryptology in 2017. It turns a block of data into ciphertext using a key, a tweak and a reflection structure, and it is built on the idea that a cipher should be fast in hardware above all, which means the design is meant to be fully unrolled into circuits, and that hardware focus is what makes it unlike the software ciphers of its era.

This article gives you five facts about QARMA, explains what it is, how it works, and why it still matters.

Key takeaways

  • QARMA is a tweakable block cipher from 2016, by Avanzi.
  • It comes in 64-bit and 128-bit block sizes.
  • Its key is twice as long as its block.
  • It is a reflection cipher built on Even-Mansour rounds.
  • It signs pointers in ARM’s Pointer Authentication.

What QARMA is

The first fact is that QARMA is tweakable, which means it takes three inputs instead of two. A normal block cipher takes a key and a block, but QARMA also takes a tweak, which means the same key encrypts the same block differently under different tweaks, and because the tweak can be an address, each memory location gets its own encryption for free.

The second fact is that it comes in two sizes. QARMA-64 works on 64-bit blocks with a 128-bit key, and QARMA-128 works on 128-bit blocks with a 256-bit key, which means the family covers both tiny hardware and general computing, and because the tweak is always the same size as the block, the design stays balanced.

The third fact is that it is a reflection cipher. QARMA encrypts by running forward rounds, then a central pseudo-reflector, then the same rounds in reverse, which means decryption is almost the same circuit as encryption, and because the two directions share their hardware, the cipher is cheap to build.

The fourth fact is that it is built for memory encryption. QARMA was designed to encrypt memory and to sign pointers, which means it guards data sitting in RAM and return addresses sitting in registers, and because those jobs need very low latency, the cipher was tuned for speed in circuits rather than in code.

The fifth fact is that it survived as a real deployment, not a paper design. QARMA signs pointers in ARM’s Pointer Authentication, which means it runs in millions of phones today, and that deployment is the reason it is the first example engineers meet when they learn that tweakable ciphers guard real hardware.

Our guide to Midori explains the low-energy cipher of the same lightweight era, and our guide to SKINNY explains the tweakable cipher that took a different path to the same goal.

How QARMA works

Everything starts with the key, which is split into a whitening key and a core key. QARMA takes its long key and divides it into two parts, which means the outer rounds and the inner rounds use different key material, and because the split is fixed, the same key always gives the same division.

Each round begins with the state, a four-by-four grid of small cells. QARMA adds the round key, shuffles the cells, passes them through S-boxes and mixes them with an Almost MDS matrix, which means every round spreads the state a little further, and because the matrix is almost maximally diffusive, a small change spreads across the whole grid.

The tweak is what makes the design work as a whole. The tweak is mixed into the state at every round through a simple schedule, which means the encryption changes with the tweak as well as the key, and because the tweak schedule is cheap, the extra input costs almost nothing in hardware.

The reflection spreads the effect further. After the forward rounds, QARMA passes the state through a central pseudo-reflector and then runs the rounds backwards, which means the second half of the cipher mirrors the first, and because the mirror shares the same components, the circuit stays small.

The S-boxes are what keep the design fast. QARMA uses small 4-bit S-boxes chosen by a search for low latency, which means each substitution is quick in a circuit, and because the S-boxes are the only nonlinear part, the cipher’s speed depends on them more than on anything else.

The ciphertext comes from the final state, read out after the last whitening. QARMA xors the whitening key into the state one last time, which means the result is a fixed-size block whatever the input, and that size is exactly what a memory word or a pointer needs for its protected form.

A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it
A dark office desk with a laptop showing a glowing green cipher diagram, a brass key and a notebook beside it, shows how QARMA works: a grid of cells takes turns shuffling through the reflection rounds, round after round, until ciphertext emerges.

Comparing QARMA with other lightweight ciphers

QARMA is one of several lightweight ciphers built for hardware, and each was built with a different emphasis. Midori is the low-energy cipher tuned for tiny power budgets, SKINNY is the tweakable cipher built for the smallest possible area, and QARMA is the one tuned for the lowest latency, while each approach trades something for something else.

The table below sets out the main contrasts between the leading approaches.

Aspect QARMA Midori SKINNY
Block size 64 or 128 bits 64 or 128 bits 64 or 128 bits
Tweakable Yes No Yes
Key size 128 or 256 bits 128 bits Up to 384 bits
Year 2016 2015 2016
Best for Low-latency hardware Low-energy devices Smallest-area hardware

The practical result is that QARMA is the right choice for low-latency hardware, Midori suits low-energy devices, and SKINNY fits smallest-area hardware instead.

Where QARMA is used

ARM chips use it to sign pointers. Pointer Authentication uses QARMA to stamp return addresses with a short code, because a forged return address is the classic way to hijack a program, and that protection is the reason QARMA runs in millions of phones.

Memory encryption uses it to guard RAM. A system that encrypts memory needs a cipher that adds almost no delay, because every memory access pays the cost, and that low latency is the reason QARMA was designed for fully unrolled hardware.

Software security uses it for short tags. Hardware-assisted defences need a cipher that can stamp a short tag on a pointer quickly, because the tag must be checked on every use, and that speed is the reason QARMA’s design was tuned for latency above all.

Research uses it as a case study in tweakable design. Engineers still cite QARMA when they discuss how a tweak changes a cipher, because it is the clearest example of the idea in a deployed design, and that lesson shapes how new tweakable ciphers are judged today.

Teaching uses it as the reflection cipher example. Courses introduce QARMA when they explain that encryption and decryption can share a circuit, because it is the clearest case of the idea in a modern cipher, and a student who understands QARMA understands why reflection saves hardware.

Strengths and limits

The greatest strength of QARMA is its latency. A cipher designed for fully unrolled hardware encrypts in the shortest possible time, and that strength is real, measured in the published delay figures and confirmed by its deployment in ARM chips.

It is also a strength that the design is tweakable. A tweak lets one key serve many purposes safely, and that flexibility is worth more than cleverness in a field where a cipher that needs rekeying for every address is a cipher nobody fields.

The limits are real, though, and the biggest is that it is a hardware cipher. QARMA is not meant for round-based software implementations, which means it must never be judged by its software speed, and a system that needs a software cipher must use a different design instead.

QARMA checklist

  • Use QARMA for hardware study, never as a software cipher.
  • Remember it takes a key, a tweak and a block.
  • Note the key is twice as long as the block.
  • Compare it with SKINNY to see two kinds of tweakable design.
  • Study the reflection, which mirrors the forward rounds.
  • Check the tweak schedule, which mixes the tweak every round.
  • Keep real secrets behind standard ciphers, not QARMA alone.
  • Read the 2016 paper to see how the family was built.
  • Choose a software cipher when hardware is not available.

Frequently asked questions

What is QARMA in simple terms?

It is a 2016 tweakable block cipher that encrypts 64-bit or 128-bit blocks using a key and a tweak, built for very fast hardware.

Who designed QARMA?

Roberto Avanzi at Qualcomm, who published it in 2016 and in the IACR Transactions on Symmetric Cryptology in 2017.

How is QARMA different from SKINNY?

Both are tweakable lightweight ciphers, but QARMA is a reflection cipher tuned for low latency while SKINNY is tuned for the smallest area.

Is QARMA still secure?

Yes, it is deployed in ARM Pointer Authentication, and a redesigned version called QARMAv2 appeared in 2023 with tighter margins.

Where is QARMA used?

In ARM chips for pointer signing, in memory encryption research, in software security defences, and in teaching about tweakable ciphers.

When should I use QARMA?

When you study hardware ciphers, when you learn about tweaks, or when you want the cipher behind ARM pointer signing.

The bottom line

QARMA explained in one line is this: the tweakable cipher, a 2016 design of reflection rounds and a third input that guards pointers and memory and taught the field that a tweak is worth more than a second key.

It is proof that latency is a security feature, and the reason it still matters is that every hardware cipher designed since has been judged partly by the lesson QARMA taught.

This article is general information about how QARMA works, not advice about choosing encryption for a particular device or system.

Latest articles

Scroll to Top