Fewest Toffoli gates for AES encryption with key expansion
The cost of a quantum AES oracle sets the price of Grover key search, and NIST's post-quantum security categories are defined by attacks on AES-128, AES-192 and AES-256. Published circuits differ in interface, gate set and clean-up; here every circuit implements the same complete map and is scored the same way.
Verifier
The verifier checks your file and computes its score. QArena runs the same code on every submission.
Verifications of this board run on the first lane of this list that is up and has room: the Mac mini, then CU Boulder's Alpine, then NCAR Derecho, then RunPod. A lane that is down, full or slow passes the file to the next one automatically, with the same verifier version; the limits of one verification are 300 s of CPU, 570 s of wall time and 2,048 MB of memory on the Mac mini, and 600 s of CPU, 1,020 s of wall time and 2,048 MB of memory on CU Boulder's Alpine, NCAR Derecho and RunPod (2 times the board's own CPU and wall time on the other lanes, because their processors are slower); the result goes to QArena only.
Download the bundle, extract it and run these commands from its folder (the one holding verifiers/). The bundle
includes an accepted example file.
python3 -I verifiers/run_one.py aes aes128-exact-wide-v1 example/aes128-exact-wide-v1.json
The verifier prints one line of JSON with a status: accepted with the score, rejected with the reason,
or error if verification could not finish.
Files
| File | Role |
|---|---|
| run_one.py | Runs the verifier |
| common.py | Shared helpers |
| aes.py | Validates submissions for this problem |
How verification works
The verifier first runs every declared S-box block on all 65,536 pairs of input byte and target byte at once (one 65,536-bit integer per wire) and checks that it adds S(x) or S^-1(x) to the target, keeps x, and returns every ancilla to 0 or, for declared garbage wires, to a function of x alone. It then replays the circuit symbolically: every wire holds an XOR of atoms (the constant 1, each original input bit, each output bit of each distinct S-box application, each garbage bit), CALL requires clean ancillas, UNCALL requires exactly the garbage its CALL left, and an inverse S-box applied to the eight outputs of one S-box application gives back its input. FIPS 197 key expansion and encryption are evaluated in the same algebra, and the circuit is accepted only if the outputs equal the target plus the ciphertext and every other wire is restored. Equal expressions are equal Boolean functions, so acceptance proves the map on every input. The verifier is standard-library Python; a second, independently written program (NumPy arrays over all input pairs for the blocks, Python sets of atoms, its own AES) is compared with it on baselines and mutated files.