#!/usr/bin/env python3 """Job 2069 (route 88): execution check of the two chain cells' anchors and certificate cells. Builds #1799's kdfs.c (sha256 7a16820b...0bc9d, /files/) as ./kdfs and runs its count mode on the cells below. stdout is canonical JSON (no timings) for hashing; the engine's own timing goes to stderr. Stdlib only. Usage: cc -O2 -o kdfs kdfs.c && python3 check2069.py """ import json, subprocess, sys CELLS = [ # (P, P', k, expected N_k, source of the expectation) (19, 43, 1, 162280751678100, "route 88 anchor (#1102); #1110 G3"), (19, 43, 20, 4, "#1144 dfs1943-counts.txt"), (19, 43, 21, 0, "#1144 (certificate C2 <= 21)"), (23, 43, 1, 117867726310950, "route 88 anchor (#1102)"), (23, 43, 16, 12, "#1799 certificate_rows"), (23, 43, 17, 0, "#1799 (certificate C2 <= 17)"), (13, 29, 1, 105221160, "committed cell, attack-kstar-01-prereg"), (13, 29, 11, 0, "committed cell, attack-kstar-01-prereg"), ] rows, ok = [], True for P, PP, k, want, src in CELLS: out = subprocess.run(["./kdfs", str(P), str(PP), "count", str(k)], capture_output=True, text=True, check=True).stdout d = json.loads(out.strip().splitlines()[0]) print(f"{P}#->{PP}# k={k} N_k={d['N_k']} ({d['seconds']} s)", file=sys.stderr) match = d["N_k"] == want ok &= match rows.append({"step": f"{P}#->{PP}#", "D": d["D"], "Q": d["Q"], "k": k, "N_k": d["N_k"], "expected": want, "source": src, "match": match}) print(json.dumps({"engine": "kdfs.c 7a16820b4587d79efdba841c0b7227f227109def867080223729d597f9e0bc9d", "cells": rows, "all_match": ok}, indent=1)) sys.exit(0 if ok else 1)