1. Introduction
Side-channel attacks exploit the statistical dependence between the physical behavior of a cryptographic implementation (its instantaneous power consumption, electromagnetic emission, or execution timing) and the secret data it processes. Differential and correlation power analysis (DPA/CPA) recover secret keys by correlating many such physical traces against hypotheses about intermediate computations, and they remain one of the most practical threats to embedded and smartcard implementations of otherwise mathematically sound ciphers. Masking is the standard algorithmic countermeasure: sensitive data is randomized before it ever touches the physical device, so that, under an idealized leakage model and correct implementation assumptions, low-order observations are intended to reveal no exploitable statistical dependence on the secret, and the dependence only reappears when an attacker combines information from multiple, ideally independent, shares.
Linear complementary dual (LCD) codes occupy a central role in one influential family of masking schemes. Introduced by Massey [
1] as a solution to an information-theoretic coding problem unrelated to cryptography, an LCD code is a linear code whose intersection with its dual is trivial. Massey showed that LCD codes are asymptotically good and give an optimum solution to the two-user binary adder channel. Decades later, Carlet and Guilley [
2] observed that this same algebraic property makes LCD codes ideal building blocks for masking countermeasures against side-channel and fault-injection attacks because the trivial intersection with the dual guarantees that source data and mask can be recovered unambiguously and securely combined. Bringer, Carlet, Chabanne, Guilley, and Maghrebi [
3] formalized this into orthogonal direct sum masking (ODSM): the protected representation of a sensitive word
is
, where
G generates a code
C carrying the source data,
H generates a complementary code
D carrying a fresh random mask
, and the direct-sum structure
guarantees that
and
can be projected out unambiguously from
. When
, the direct-sum condition
is exactly the statement that
C is LCD. The security intuition is standard: an attacker observing a physical leakage function of
should learn as little as possible about
. Two distinct leakage models are used in this literature, and we are precise about which one this paper adopts. The Hamming distance model takes leakage to be proportional to the number of bit transitions between two successive states of a data bus or register (the mechanism most directly tied to CMOS switching power); the Hamming weight model, which we adopt throughout, takes leakage to be proportional to the number of nonzero (set) bits of a single state, with no reference to a previous state. The two coincide, up to an additive constant, precisely when the bus or register is systematically precharged to the all-zero state before every new value is loaded (a common assumption for precharged buses and certain register-transfer-level designs), so that each transition is effectively a transition from zero; outside that implementation condition, Hamming distance leakage need not reduce to Hamming weight leakage, and our results should be read as applying to the Hamming-weight model specifically. This is achieved, in either model, by making
as large as possible, so that low-weight leakage differences cannot be attributed to any single bit of
. Since
throughout this paper,
: the classical “dual distance of the mask” referenced in the ODSM literature is, in our notation, simply
, the minimum distance of the source code. We fix this convention precisely in
Section 3 to avoid the ambiguity that can arise between
,
, and
, three generally distinct quantities.
Much of the literature that followed has optimized distance parameters such as
,
, or
, with little explicit analysis of higher moments. Carlet, Li, and Mesnager [
4] constructed optimal pairs of linear codes maximizing
and
jointly subject to length and dimension constraints. A large and still very active line of work constructs explicit families of cyclic and constacyclic LCD codes: via Galois inner products [
5,
6], BCH-type defining sets of length
[
7,
8], and algebraic-geometry or subspace codes [
9,
10]. Each new family is reported essentially by its
parameters. Even papers whose stated motivation is precisely side-channel resistance stop at this level: constructions of LCD codes from algebraic curves are explicitly justified as resistant to side-channel attacks, yet the quantitative verification of that resistance is left as declared future work rather than carried out.
This is the gap this paper addresses. The dual distance
is a worst-case descriptor: it certifies that no single low-weight leakage event can occur, but it says nothing about the shape of the leakage distribution above that floor. Two masking codes with the same
can have weight distributions that look almost binomial (the behavior of a “generic” random code) or, instead, concentrate substantial probability mass on a handful of extreme weights far from the mean, a difference with direct consequences for the variance of any Hamming-weight leakage model built on top of the mask. We stress at the outset, and return to at length in
Section 7 and
Section 8, that this variance is a second-order algebraic descriptor of leakage dispersion under an idealized Hamming-weight leakage model. It should not be interpreted as a complete side-channel security metric: it does not by itself determine attack success probability, signal-to-noise ratio, mutual information, guessing entropy, or the number of traces an attacker would require, none of which are analyzed in this paper. What we show is narrower and, we believe, still useful: that this specific, well-defined algebraic quantity is not determined by
alone, and that it
is determined exactly by a simple, new invariant of the cyclic code’s defining set, one that requires no character-sum or Gauss-period evaluation whatsoever. This stands in contrast to the classical literature on cyclic-code weight distributions, which reaches for exactly this machinery to determine full weight enumerators, a strictly harder target than the single moment we compute here.
Contributions. (1) We give a covariance decomposition for , , valid for an arbitrary cyclic code C (the LCD property is not used in the algebraic derivation). (2) We characterize dependent coordinate pairs of D through an intrinsically defined subgroup of attached to the cyclotomic defining set of C and prove this characterization is independent of any choice of coset representatives. (3) We obtain a closed-form formula for in terms of this invariant. (4) We prove that, while the LCD property leaves the numeric value of this invariant unchanged, it forces every dependent coordinate pair to be related by a sign () rather than a general nonzero scalar, precisely delimiting what LCD does and does not contribute to the result. (5) We verify the formula computationally, with an explicit worked example exhibiting the defining sets used, reproducible from the values displayed, on 64 independently constructed cyclic LCD codes, and give a concrete instance within the actively studied length- family. (6) We discuss the formula’s use, with appropriate caveats, as a second-order design diagnostic for ODSM masking codes.
The remainder of the paper is organized as follows.
Section 2 reviews the four strands of the literature this work connects.
Section 3 fixes notation and the source/mask distance convention.
Section 4 states the non-degeneracy hypothesis used throughout.
Section 5 states and proves the main algebraic results, separating the general cyclic-code statement from its LCD/ODSM application.
Section 6 reports the computational verification with a reproducible worked example.
Section 7 discusses design implications, with explicit caveats on the scope of the variance metric.
Section 8 states limitations, and
Section 9 concludes.
3. Notation and the Source/Mask Distance Convention
Throughout, q is a prime power and n a positive integer with . Let m be the multiplicative order of q modulo n, and fix a primitive n-th root of unity . A cyclic code of defining set (a union of q-cyclotomic cosets modulo n) is . We write , also cyclic, for the code used as the ODSM masking code when C is LCD.
We fix a single notational convention to avoid ambiguity:
,
, and
denote three a priori distinct quantities. Since
and
for finite fields, we have the identity
The quantity the ODSM literature calls the “dual distance of the mask” is
, which by this identity equals
, the minimum distance of the
source code, not a property of
D in isolation. All theorems in
Section 5 are stated in terms of
, consistent with this identity;
itself (the mask’s own minimum distance, relevant to a different property, e.g., error detection in the mask) plays no role in our results and is not used.
Remark 1 (Symbol-wise versus bit-level Hamming weight). Throughout this paper, denotes the standard symbol-wise Hamming weight over : the number of nonzero coordinates of c, counting each nonzero symbol as 1 regardless of its value. This is the quantity Theorem 1 characterizes exactly. For , this symbol-wise weight coincides exactly with the physical bit-transition weight that correlates with CMOS power consumption, so the variance formula bears directly on the Hamming-weight leakage model motivating ODSM. For , this coincidence need not hold: if a field symbol is represented in hardware by a vector of bits (e.g., elements encoded as ), the physical bit-level Hamming weight of a codeword depends on the specific bit-encoding of each symbol and is generally not equal to, nor an affine function of, the symbol-wise weight ; for instance, under the encoding above, nonzero symbols 1 and 2 both contribute bit-weight 1, while our symbol-wise count treats them identically as contributing 1 regardless of encoding, but a different (equally natural) encoding could make them contribute differently, and the aggregate distribution over a full codeword depends on this choice in a way the present paper does not model. Consequently, for , Theorem 1 should be read as an exact result about a coding-theoretic quantity of independent interest, whose direct relevance to physical Hamming-weight leakage requires an additional, explicit bit-encoding model that we do not develop here; the case remains the setting in which the connection to physical leakage is immediate. We return to this point in the Limitations.
4. Non-Degeneracy Hypothesis
The main results assume and use throughout that no coordinate of D is identically zero. We record this as a lemma rather than an unstated assumption.
Lemma 1 (Non-degeneracy). Let be a nonzero cyclic code. Then, for every , the coordinate projection , , is surjective.
Proof. Suppose for some i, i.e., for every . Since D is cyclic, the cyclic shift (sending to ) maps D onto itself. For any , as well, and ; since this holds for every and , we get as well. Iterating, for every j, i.e., every coordinate of every codeword is zero, so , contradicting the hypothesis. Hence every is a nonzero -linear functional on D, hence surjective (its image is a nonzero -subspace of , i.e., all of ). □
In particular, each is a well-defined Bernoulli random variable with parameter when c is drawn uniformly from D, and .
5. Main Results
We emphasize, per the discussion in
Section 3, that the results in this section are stated for an arbitrary cyclic code
C and its dual
; the LCD property of
C is
not used in their proofs. LCD enters only in Remark 3 below, where it licenses the ODSM interpretation of
D as a masking code.
Lemma 2 (Generic case)
. If , thenexactly, independent of any other structural property of D. Proof. Fix
and let
H be a generator matrix of
D, with columns
,
, so that a codeword
satisfies
for the message
. If
and
were linearly dependent, there would exist
, not both zero, with
; the vector
v with
,
, and zeros elsewhere then satisfies
for every
m, so
is a nonzero codeword of weight
, contradicting
. Hence every pair of columns of
H is linearly independent, so the map
is a surjective linear map
with constant fiber size
:
is uniform on
over
. This gives
for every pair
, so
by Lemma 1, since each
is Bernoulli with parameter
. □
Remark 2. This lemma is a reformulation of the classical fact that if and only if is an orthogonal array of strength t [18]; we need only . Its novelty here is not the fact itself but its application below (Theorem 1) to the full range , and, with appropriate caveats (Section 7), to ODSM masking-code design. We now turn to the case , where Lemma 2 does not apply. The next lemma establishes, independently of any choice of coset representatives, that the relevant dependency structure is governed by a canonically defined subgroup of ; this addresses directly the representative-dependence concern that a definition through an arbitrarily chosen representative would otherwise leave open.
Lemma 3 (Canonical dependency subgroup). Let be the defining set of C. Define
Then is a subgroup of . Consequently there is a unique divisor of n with .
Proof. with witness . If with witnesses , then for every , and since is a group; hence, . If with witness , then for every , so . Thus is closed under addition and inverses and contains 0: it is a subgroup of the cyclic group . Every subgroup of has the form for a unique divisor L of n, giving the stated form. □
The invariant
in Lemma 3 is defined purely in terms of
T and involves no choice of representative; the following proposition shows it can nonetheless be computed via any choice of one representative per coset in
T, which is what our verification algorithm (
Section 6) uses.
Proposition 1 (Computation of
)
. Let be any representatives of the cosets comprising T (one per coset, any choice). Thenwith the convention , and this value is independent of the choice of . Proof. Fix a base representative . Within its coset , the defining condition (for the fixed witness of ) applied at gives for every ; taking gives , and then forces , i.e., , equivalently , i.e., . For each other representative , the defining condition forces , i.e., . Conversely, once d satisfies all these congruences, one checks by induction (using integer linear combinations, e.g., ) that holds for every element of every coset in T with the same ; so iff d is a common multiple of the listed moduli, i.e., a multiple of their lcm. By Lemma 3, is intrinsic to T, so this lcm—computed from any valid choice of representatives—must equal in every case, establishing representative-independence as a corollary of intrinsic well-definedness rather than as a separate combinatorial verification. □
Lemma 4 (Proportional columns and weight-two dual words). Let H be a generator matrix of , with nonzero columns . For , the columns are proportional over if and only if contains a weight-two codeword with support exactly .
Proof. Suppose are proportional. Since both columns are nonzero, there exist such that . Let have , , and zeros elsewhere. For any , , so ; since , v is a weight-two codeword of C with support exactly . Conversely, if C contains a weight-two codeword v with support exactly , write , (both in , and zero elsewhere); means for every , i.e., for every . Since H is a generator matrix, its rows are linearly independent, so H has full row rank and m ranges over the entire message space as ranges over D; in particular, the linear functional vanishing on all of forces , i.e., proportional. □
Theorem 1 (Closed-form variance formula)
. Let be a cyclic code with defining set T, , and as in Lemma 3. Thenexactly. Proof. By Lemma 4, columns
of a generator matrix of
D are proportional iff
contains a weight-two word with support exactly
. A weight-two word with support exactly
,
, lies in
C iff there exist
with
for every
, i.e., iff
(with witness
). By Lemma 3, the set of such
d (excluding 0) is exactly the nonzero part of
, of size
. The
n coordinates partition into
cosets of
, each of size
; by Lemma 4, two coordinates
have dependent (proportional) columns
iff
, i.e., iff
lie in the same coset of
. The number of dependent pairs is therefore
As in Lemma 2, independent pairs contribute zero covariance, and each dependent pair contributes
(since
for a fixed nonzero scalar
forces
identically, by Lemma 1). Hence
Corollary 1 (Domain of variation)
. If , choosing in Proposition 1 gives trivially, and reduces to . If, moreover, , then and Theorem 1 reduces exactly to Lemma 2. At the opposite extreme, gives (an empty lcm), C the single parity-check code, and D the q-ary repetition code generated by the all-ones vector, for any q. Here takes the value 0 with probability and n with probability , giving directly, matching the formula and the largest value it attains, a boundary case consistent with D being maximally structured (a single nonzero direction). Consequently, for a nonzero, proper cyclic code C, (and hence ) can differ from the generic value only when : whenever , Lemma 2 forces regardless of any other structural feature of T, so cannot distinguish among ODSM candidates with —it distinguishes only among candidates with . This delimitation is discussed further, together with its practical relevance, in Section 7. The algebraic results above make no use of the LCD property: , and hence , is determined by T alone, whether or not . This raises a natural question: does the LCD condition constrain the variance formula in any way, or does it play no algebraic role beyond licensing the ODSM interpretation of Remark 3? The next proposition shows that LCD leaves the numeric value of unconstrained but does impose a genuine, previously unremarked structural restriction on how dependent coordinates are related.
Proposition 2 (LCD restricts dependency type, not ). Suppose (i.e., C is LCD). Then for every , the witness with for all satisfies . Consequently, every pair of dependent coordinates (columns of a generator matrix of D) satisfies with : LCD forces every dependency in the masking code to be a pure sign relation, never a general nonzero scalar multiple, even though the numeric value of itself (and hence ) is unaffected.
Proof. Fix with witness , so for every . Since , for every we also have , and the same single witness must satisfy as well. But , so , i.e., . From the proof of Lemma 4 and Theorem 1, the proportionality constant between dependent columns satisfies (the witness of the underlying weight-two codeword and the column relation are reciprocal), so as well. □
For , and automatically, so Proposition 2 is vacuous; the restriction is genuinely informative only for , where can have elements of order greater than 2. We verified this contrast computationally over , : a non-LCD defining set (not closed under negation) has dependent-pair witnesses as d ranges over the nonzero elements of , with for ; the LCD-symmetrized set has a single dependent gap with witness , consistent with Proposition 2, while changes as a byproduct of enlarging the defining set, not because of the symmetry itself. This confirms both halves of the claim: symmetrizing T does not, by itself, preserve or fix ’s numeric value, but whenever a d is dependent under an LCD-symmetric T, its witness is forced to .
Remark 3 (LCD/ODSM application)
. Theorem 1 places no requirement on C beyond being cyclic. If, in addition, C is LCD (equivalently, by Yang–Massey [12], T is closed under negation modulo n), then , and can serve as the masking code in an ODSM scheme with C as the source code. All computational examples in Section 6 are additionally restricted to LCD C for this reason, even though Theorem 1 itself does not require it. Relation to the Pless Moment Identity and to Coelho–Brochero Martínez
We now position Theorem 1 precisely against two bodies of prior work, separating what is classical from what is new.
The classical part. For any nonzero, nondegenerate linear code
with
, the identity
follows directly from the Pless power moments relating the weight distribution of a code to that of its dual [
18], where
denotes the number of weight-two codewords of
C; it requires neither
C nor
D to be cyclic. Indeed, this identity is exactly what the covariance decomposition in the proof of Theorem 1 recovers:
since each of the
dependent coordinate pairs contributes exactly
weight-two codewords (one for each nonzero scalar
in the pair
,
). Substituting recovers
, matching Theorem 1 exactly. The reduction of the variance computation to counting weight-two words of
C is therefore classical, not new.
What Theorem 1 adds. The contribution is an exact, closed-form arithmetic formula for (equivalently, for ) in terms of the cyclotomic defining set T, valid for cyclic codes of arbitrary length n coprime to q and arbitrary prime-power q, together with the representative-independence result of Lemma 3 and the LCD-specific Proposition 2. This is where the present paper’s novelty is concentrated, and we delimit it further against the closest prior result below.
Coelho and Brochero Martínez (2024) [
19] independently derive, for cyclic codes
of the special length
over a prime field
(where
), a necessary and sufficient condition for
and an exact count
This is algebraically equivalent to our formula on the domain where both apply. Writing
and
to match our notation, the classical identity
for divisors
of
n gives
where
,
(
) are exactly the arguments of both
and
. Hence
, and substituting into their
formula gives
, matching the relation above exactly. On the domain
,
q prime, our closed-form
and their
are reciprocal reparametrizations of the same arithmetic quantity.
We flag plainly that every numerical example in this paper (
Section 6.2,
Section 6.3 and
Section 6.4) falls inside this domain:
,
, and
are all of the form
for a prime base field, and the length-20 example of
Section 6.4 similarly reduces to it. What remains new relative to [
19], and is not illustrated by these particular examples, is the extension to (i) arbitrary length
n coprime to
q, not restricted to
for the specific extension degree
, and (ii) arbitrary prime-power base fields
q, not restricted to
q prime. Both extensions follow from the same proof (Proposition 1), which never uses
or
q prime, and we verify each concretely rather than merely asserting them. For the extension to
: with
,
(here
, but
, so
is a proper divisor of
and
not of the form
addressed in [
19]), the defining set
gives an LCD code with
(so
) and
, confirmed by direct brute-force enumeration of
D. For the extension to non-prime
q, which [
19] excludes by construction (their base field is
for
p prime): with
and
(so
q itself is a prime power, not a prime, and
for any
m), factoring
directly over
gives five irreducible factors of degrees
; taking the defining set
(the three linear factors) gives an LCD code with
,
,
(so
), and
, again confirmed by direct brute-force enumeration of
D. Both instances lie outside the domain of [
19] — the first through
n, the second through
q — and both are correctly predicted by Theorem 1 nonetheless.
7. Discussion: Scope and Design Implications for ODSM
Theorem 1 shows that the invariant governing whether a cyclic masking code’s Hamming-weight variance can deviate from the generic value is , and, by Corollary 1, exactly when . We state this domain restriction explicitly since it delimits the entire practical scope of the result: for a nonzero, proper cyclic code, can differ from n, and can differ from the generic value, only when . Among candidates with , is identically n and provides no further distinguishing information whatsoever; the entire distinguishing power of Theorem 1 is concentrated in the regime, where it refines (equivalently ) beyond the mere fact that a weight-two word exists. Since is a parameter of the source code, already maximized in standard ODSM design for error-correction reasons unrelated to side-channel resistance, this exposes a design tension: pushing up for error-correction capacity simultaneously forces the masking code’s Hamming-weight variance to its unique minimum-variance value, collapsing any distinguishing power of , while permitting opens access to a computable range of variances via .
On the practical relevance of the case
: in ODSM designs that maximize
purely for combined error-correction and leakage-floor reasons, Theorem 1 contributes nothing beyond Lemma 2’s single generic value, and the reader may reasonably ask what the theorem adds outside that regime. Three points bear on this. First, Theorem 1 is a complete characterization across all
, not one restricted to
: it shows that this is the only regime where variance-based comparison among candidate codes is possible at all, a boundary fact not previously stated in the literature we surveyed (
Section 2.2 and
Section 2.3). Second, not every legitimate design constraint forces
: a designer working under a fixed rate
, a specific structural requirement (e.g., a prescribed automorphism group or compatibility with an existing hardware datapath), or a deliberate choice to trade distance for a different property may end up with
candidates that Theorem 1 lets the designer immediately evaluate rather than treat as unanalyzable. Third, and more modestly, the formula serves an auditing role: given any candidate LCD code with
, whatever its provenance,
lets one check in closed form, without brute-force enumeration or full weight-enumerator computation, exactly how far its masking-code variance sits from the generic value.
On the ODSM security interpretation. We restrict the claims above to an algebraic invariant of the masking code D itself and deliberately stop short of a direct side-channel security interpretation for a specific reason worth stating precisely. In ODSM, the leaked quantity for a fixed secret is the physical function of , and is uniformly distributed over the coset , not over D itself; Theorem 1 characterizes for , which is the special case . Whether, and how, this coset-zero variance relates to the variance of for a general nonzero secret is a separate question this paper does not answer; more importantly, so is whether it relates to an attacker’s ability to distinguish between the leakage distributions of different values of , which is what actually governs side-channel security. We have not established a conditional-moment analysis across the cosets , nor any bound relating to a concrete attack metric. Consequently, we present here strictly as an algebraic invariant of the masking code, useful for comparing candidate masking codes’ zero-secret leakage dispersion under an idealized model, and not as a direct descriptor of ODSM security in the sense of secret-distinguishing advantage; establishing that connection rigorously is left to future work.
On the state of the code-based masking literature. An earlier version of this manuscript stated that the literature optimizes only distance parameters, with no examination of higher moments. This was incorrect, and we correct it here. A substantial and directly relevant line of work, comprising Guilley, Heuser, and Rioul [
20]; Poussier, Guo, Standaert, Carlet, and Guilley [
21]; Cheng, Guilley, Carlet, Mesnager, and Danger [
22]; Cheng, Liu, Guilley, and Rioul [
23]; and, most recently, Chen, Fan, Cheng, and Zhou [
24], already goes beyond the dual distance
alone, jointly optimizing it together with the kissing number
(the number of minimum-weight codewords in the dual, a close relative of our
when the minimum weight is 2), and validates the resulting ordering with simulated attack experiments (success rate versus number of traces) rather than distance parameters alone. This body of work is a materially different, more mature undertaking than a distance-tuple comparison, and we no longer claim otherwise. Our contribution relative to it is narrower and more specific: an exact, closed-form arithmetic characterization of
(equivalently
) for cyclic codes via their cyclotomic defining set, requiring no enumeration of the kissing number, together with its precise algebraic relationship to
via the classical Pless moment identity (Section Relation to the Pless Moment Identity and to Coelho–Brochero Martínez): a complementary, purely algebraic tool that could in principle feed into the kissing-number-based design methodology of this literature for the cyclic case, rather than a competing or more complete security framework.
On the relation to Coelho and Brochero Martínez. As detailed in Section Relation to the Pless Moment Identity and to Coelho–Brochero Martínez, the special case of our result where
for
Q a power of the prime
q is algebraically equivalent to the
formula of Coelho and Brochero Martínez [
19], published in 2024. All numerical examples in this paper (
Section 6.2,
Section 6.3 and
Section 6.4) happen to fall inside this special case since
,
,
, and
are all of this restricted form or reducible to it; we flag this explicitly rather than let the examples imply a broader novelty than the arithmetic warrants. The generalization that remains new is to arbitrary length
n coprime to
q (not necessarily of the form
) and to arbitrary prime-power base fields
q (not necessarily prime), together with the reformulation via the canonical subgroup
, the connection to
and ODSM, and the LCD-specific Proposition 2.
We emphasize throughout that
is a second-order algebraic descriptor of leakage dispersion under an idealized Hamming-weight leakage model with no measurement noise, computed for the zero-secret coset. It does not by itself determine DPA/CPA success probability, signal-to-noise ratio [
25], mutual information, guessing entropy, or the number of traces required for a successful attack [
26]; none of these quantities are analyzed in this paper, and none should be inferred from
alone without a fully specified attack model, noise model, and empirical validation against real or simulated traces. Nor does equal variance imply equal leakage security in a stronger sense: two masking codes with identical
can still differ substantially in higher moments or in the full shape of the weight distribution, a limitation we return to in
Section 8. With all these caveats,
is best read as a low-cost, exactly computable algebraic quantity for the
regime: for a target dimension pair
with
forced or accepted, a designer can enumerate the cyclotomic-coset combinations achieving that dimension and directly compute
for each, without ever evaluating a full weight enumerator or kissing number by brute force.
8. Limitations
This work is restricted to cyclic codes; the extension to constacyclic codes (
), which underlies the actively studied LCD BCH constructions of length
[
7,
8], is not addressed here. A preliminary check shows the extension is not a routine substitution: for
-constacyclic codes the relevant root of unity has order
(for
) rather than
n, which changes the dependency condition at the core of the proof of Theorem 1 and requires a separate derivation.
As detailed in Remark 1,
is computed with respect to the symbol-wise Hamming weight over
. This equals the physical bit-transition weight relevant to CMOS power leakage only for
. For
, the relationship between symbol-wise weight and physical bit-level leakage depends on an explicit encoding of field symbols into bit vectors, which this paper does not model; the
instances of Theorem 1 (including the worked example of
Section 6.4) should accordingly be read as exact results of independent coding-theoretic interest, whose side-channel relevance for
hardware requires this additional, unaddressed modeling step.
The variance metric used here is, as stressed in
Section 7, a simplified algebraic proxy under an idealized Hamming-weight leakage model. It does not incorporate measurement noise, higher-order masking, non-Hamming-weight leakage functions, or any of the standard quantitative side-channel metrics (success rate, signal-to-noise ratio, mutual information, guessing entropy); no experimental or simulated side-channel evaluation (DPA/CPA traces) was performed, and none of the claims in this paper should be read as a substitute for one. Relatedly, equal variance does not imply equal leakage security: two masking codes can share
while differing substantially in higher moments or in the full shape of their weight distribution, which Theorem 1 does not characterize.
Finally, the literature search supporting the novelty claims in
Section 2 was targeted rather than systematic (protocol described in
Section 2.5), which limits the strength of broad bibliographic claims; the correction of the literature narrative in
Section 7 (regarding the state of the art in dual-distance/kissing-number optimization) illustrates this limitation concretely.
9. Conclusions
This paper is, at its core, a contribution to the algebraic theory of cyclic codes, motivated by but ultimately separable from its cryptographic application. As Section Relation to the Pless Moment Identity and to Coelho–Brochero Martínez makes precise, the reduction of
to counting weight-two codewords of
C is the classical Pless moment identity, and the closest existing result, Coelho and Brochero Martínez’s 2024 formula for
on primitive-length codes over prime fields [
19], is algebraically equivalent to ours on its domain. What we contribute is the extension of that arithmetic characterization, via the canonically defined subgroup
and the invariant
, to cyclic codes of arbitrary length
n coprime to
q and arbitrary prime-power base fields
(both verified concretely in Section Relation to the Pless Moment Identity and to Coelho–Brochero Martínez, including a non-prime-field instance over
), together with the LCD-specific Proposition 2 showing that the LCD property, while leaving
’s numeric value unchanged, forces every dependent coordinate pair to be related by a sign rather than a general scalar. These are coding-theoretic results, verified without exception against 64 independently constructed cyclic codes across three finite fields and four lengths, and they stand on their own within that discipline.
The motivating application, orthogonal direct sum masking, is where
is interpreted as a masking code and
as the dominant distance-based descriptor used in much of the current LCD/ODSM literature; we showed that this descriptor alone does not determine
, and that
does so exactly, within the narrow regime
where such distinction is possible at all (Corollary 1). We have been explicit that this variance, computed for the zero-secret coset of the masking code, is a second-order algebraic descriptor under an idealized leakage model, not a complete side-channel security metric, and that a substantial existing literature (
Section 7) already evaluates code-based masking through the more operational combination of dual distance and kissing number, validated by simulated attacks, a materially more complete methodology than the one presented here. We position
as a low-cost, closed-form algebraic quantity that could complement that methodology for the cyclic case, not as a replacement for it. Constacyclic extension, a systematic literature review, and empirical side-channel validation remain as future work before any such complementary role could be established in practice.