{
  "id": "2026/1584",
  "url": "https://opencryptology.org/2026/1584",
  "original_url": "https://eprint.iacr.org/2026/1584",
  "title": "Beyond Affine Invariants: A Hamming-Weight Correlation Metric for Template-CPA Leakage in Key-Dependent S-boxes",
  "authors": [
    "Wiesław Maleszewski"
  ],
  "affiliations": null,
  "abstract": "Classical selection criteria for cryptographic S-boxes—nonlinearity $\\mathrm{NL}$, differential uniformity $\\delta$, boomerang uniformity $\\beta_{\\mathrm{B}}$, algebraic degree $\\deg$—are invariants of affine equivalence. That property is exactly what blinds them to a class of side-channel weaknesses. The correlation-power-analysis (CPA) template distinguisher is governed by the Hamming-weight functional, and Hamming weight is not affine-invariant; it does not descend to the affine-equivalence quotient on which the classical criteria live. Two S-boxes with identical $(\\mathrm{NL},\\delta,\\beta_{\\mathrm{B}},\\deg)$ can therefore leak differently under template CPA. We make this precise for the key-dependent family $S^{\\mathcal{G}}(x)=A\\,\\iota(x)\\oplus c$, with $\\iota$ the multiplicative inverse in $\\mathrm{GF}(2^8)$ and $(A,c)\\in\\mathrm{GL}(8,\\mathbb{F}_2)\\times\\mathbb{F}_2^8$ drawn from a byte stream $\\mathcal{G}$. A structural proposition fixes the four invariants at $(112,4,6,7)$ across the entire family; they carry no information about $\\mathcal{G}$. We introduce the Hamming-weight template correlation $\\rho_{\\mathrm{HW}}(\\cdot,S_{\\mathrm{AES}})$, identify it as the population statistic controlling the AES-template CPA distinguisher, and show that it resolves the fiber the classical invariants collapse. As a stress test we instantiate $\\mathcal{G}$ with three sources of contrasting regularity—a system CSPRNG, a discretised logistic map, and a $\\sin(1/x)$/xxHash hybrid—and sample $3\\times10^{5}$ S-boxes from a single master seed. The classical invariants are identical everywhere, as predicted. The metric is not. The logistic source widens the $\\rho_{\\mathrm{HW}}$ distribution against $S_{\\mathrm{AES}}$ by $12$–$13\\%$ ($\\sigma_\\ell=0.0704$ vs. $0.0626/0.0623$; Levene $p<10^{-180}$). The widening vanishes against a uniform-random reference permutation (Levene $p>0.13$), survives an exact Q1.31 fixed-point reimplementation at $3.1\\%$, and does not appear for a tent-map control. Propagated through the Mangard–Oswald–Popp trace-budget model and checked against a $2.16\\times10^{5}$-attack Monte-Carlo CPA simulation, it yields a $29\\%$ relative excess in AES-template success rate at $\\mathrm{SNR}=10$, $N=10^3$ (empirical ratio $1.29$, analytic $1.26$). By every standard effect-size measure the widening is small (Cohen's $d=0.128$ on $|\\rho_{\\mathrm{HW}}|$, Cohen's $h=0.130$ on the attackable fraction); its significance is detectability, not magnitude. The contribution is a measurement axis, not a weak generator: a metric that flags template-CPA leakage where $\\mathrm{NL}=112$, $\\delta=4$ report perfect scores.",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Beyond Affine Invariants: A Hamming-Weight Correlation Metric for Template-CPA Leakage in Key-Dependent S-boxes” by Wiesław Maleszewski, Cryptology ePrint Archive, Paper 2026/1584, https://eprint.iacr.org/2026/1584. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2026-08-03T05:37:06Z",
    "updated": "2026-08-05T06:33:30Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2026/1584.pdf",
    "sha256": "3eac59864430b13d5ceb1ca1bdd3e68fb7ba42a9682856829a6972e8c020b1da",
    "size": 401266,
    "source": "wayback",
    "source_date": "2026-10-02T08:26:05Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "eprint_size": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2026/1584/versions/20261002T082605Z.pdf",
      "captured_at": "2026-10-02T08:26:05Z",
      "label": "copy captured 2026-10-02",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20261002082605id_/https://eprint.iacr.org/2026/1584.pdf",
      "size": 401266,
      "sha256": "3eac59864430b13d5ceb1ca1bdd3e68fb7ba42a9682856829a6972e8c020b1da",
      "is_default_pdf": true
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20261002082605id_/https://eprint.iacr.org/2026/1584.pdf",
      "captured_at": "2026-10-02T08:26:05Z",
      "size": 383030
    }
  ],
  "bibtex": "@misc{cryptoeprint:2026/1584,\n      author = {Wiesław Maleszewski},\n      title = {Beyond Affine Invariants: A Hamming-Weight Correlation Metric for Template-CPA Leakage in Key-Dependent S-boxes},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2026/1584},\n      year = {2026},\n      url = {https://eprint.iacr.org/2026/1584}\n}"
}
