Paper 2026/1584

Beyond Affine Invariants: A Hamming-Weight Correlation Metric for Template-CPA Leakage in Key-Dependent S-boxes

Wiesław Maleszewski, University of Lomza
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.

Note: Revision (v2): removed three pairs of duplicated paragraphs in Sections 4.4-4.6, which restated the same measurements twice (row-collision rates, the integer-only Q1.31 experiment, and the tent-map control). All unique content, numbers and statistics are preserved and no result has changed. The manuscript was also reset from a journal-specific class to a neutral layout, which accounts for the reduced page count.

Metadata
Available format(s)
PDF
Category
Implementation
Publication info
Preprint.
Keywords
correlation power analysisHamming-weight leakageaffine invariantskey-dependent S-boxesS-box evaluation
Contact author(s)
wmaleszewski @ al edu pl
History
2026-08-05: revised
2026-08-03: received
See all versions
Short URL
https://ia.cr/2026/1584
License
Creative Commons Attribution
CC BY

BibTeX

@misc{cryptoeprint:2026/1584,
      author = {Wiesław Maleszewski},
      title = {Beyond Affine Invariants: A Hamming-Weight Correlation Metric for Template-{CPA} Leakage in Key-Dependent S-boxes},
      howpublished = {Cryptology {ePrint} Archive, Paper 2026/1584},
      year = {2026},
      url = {https://eprint.iacr.org/2026/1584}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.