Shannon entropy is a standard measure of ciphertext randomness, evaluated either globally over the byte histogram of the entire ciphertext or locally as the average over non-overlapping blocks of fixed size. While the global statistic captures only the overall byte distribution, the local statistic is also sensitive to non-randomness that is confined to parts of the ciphertext. Both measures are commonly assessed against reference values derived under the assumption of independent uniform bytes. However, STL encodes most numerical data as single-precision IEEE-754 floats, and format validity requires them to be finite, causing nonuniform byte probabilities and dependence between the two bytes of each exponent pair. We derive the exact mean and variance of entropy under the valid-STL (VSTL) distribution, which assigns equal probability to every admissible sequence of triangle records, and provide second-order expansions that keep the global reference values practical to compute at large file sizes. Using these expansions, we establish a two-sided hypothesis test for the global entropy statistic, whose limiting value is lowered from 8 to 7.99991479609 bits. The format constraints also change the local entropy reference: applying the capacity energy criterion to triangle records selects a block size of 1950 bytes instead of 1936 bytes, with an exact reference mean of 7.903106732975 rather than 7.902469316647 bits. Although small, these shifts are sufficient to place the VSTL reference means outside the conventional 95% acceptance intervals at practical file sizes, making unadjusted entropy tests prone to falsely rejecting ideal VSTL ciphertexts.
Monte-Carlo simulations confirm all reference values within sampling error. We therefore recommend using the format-specific reference values derived here to evaluate STL ciphers.
Keywords: 3D model encryption, STL, randomness testing, Shannon entropy, entropy estimation
1. Introduction
Additive manufacturing uses digital three dimensional (3D) models to produce physical parts, from prototypes to aerospace components and medical devices [1]. As their geometry may disclose proprietary information, protecting design data is part of securing the manufacturing process, in which theft of technical data is a principal threat [2]. STL represents the geometry as a triangulated surface and remains a common exchange format in this workflow [1, 3].
The statistical evaluation of encryption methods for 3D models commonly uses measures adapted from image encryption. Our foundational work [4] examined this transfer for NPCR and UACI and showed that their conventional reference values require adjustment for STL validity constraints. The same issue arises for Shannon entropy [5]: its reference values must reflect the admissible ciphertext encodings.
Global entropy is computed from the byte histogram of the entire ciphertext, whereas local entropy [6] averages the same measure over disjoint blocks of fixed size and is also sensitive to departures from randomness confined to parts of the ciphertext. The conventional reference values for both measures assume independent and uniformly distributed bytes.
In practice, however, evaluations of the global measure often report values close to the theoretical maximum of 8 bits, without specifying acceptance bounds for the given sample size. Such proximity alone does not establish consistency with the assumed null model. A two-sided hypothesis test provides a more rigorous assessment because it rejects values that are either unusually low or unusually high.
Even under the uniform model, the expected entropy is strictly below the theoretical maximum for every finite sample size — classical estimation results quantify the bias and variability [7, 8, 9].
As established in [4], a valid STL file does not satisfy the assumption of independent uniform bytes because each triangle record is composed mostly of IEEE-754 single-precision floats [10], for which the validity constraint excludes NaN and ±∞. Consequently, the valid-STL (VSTL) distribution is uniform over admissible encodings and has nonuniform byte probabilities that vary by position, together with dependence between the exponent bytes of each float.
This paper therefore introduces a hypothesis test for the global entropy of valid STL files, adjusts the established local test, and provides reference values and acceptance bounds appropriate to the assumed distribution and sample size for both measures.
We derive exact global and local entropy moments from the individual and joint laws of byte counts in triangle records under the VSTL model. For global entropy, second-order expansions make the reference moments efficiently computable for large files. For local entropy, we determine the optimal block size under the VSTL model by adapting the capacity energy criterion [6]. Normal approximations provide two-sided acceptance bounds for both tests.
Although the validity constraint induces seemingly small shifts in the entropy references, these differences become practically relevant for both tests as their acceptance intervals narrow. For local entropy, the change in block size further accentuates this effect.
The remainder of the paper is organized as follows. Section 2 defines the notation used throughout the paper and recalls the VSTL distribution from our foundational work. Section 3 derives the exact block entropy moments. Section 4 develops the global entropy test, while Section 5 adapts the local test; both examine their practical significance and validate their corresponding reference values through Monte-Carlo simulations. Finally, Section 6 concludes the paper.
2. Preliminaries and Notation
Most of the notation and structural facts in this section follow our foundational work [4]; we restate only those needed for the entropy analysis.
2.1. The Byte Alphabet and Its Named Subsets
Write V={0,…,255} for the byte alphabet, so that Vk is the set of k-byte sequences. Two pairs of subsets of V recur throughout, the halves and the majority sets:
The two majority sets drop 127 and 255, respectively; these values are the minority bytes.
2.2. Validity Constraint
A valid float is any finite IEEE-754 single-precision 32-bit number [10] whose exponent field is not 0xFF; subnormals and signed zeros are retained, NaN and ±∞ excluded. The set F⊂{0,1}32 of valid encodings has cardinality ∣F∣=232−224=4278190080.
Each float (s,e0...e7,m0...m22) splits into four bytes, from most to least significant:
Since e=0xFF reads ¬(e0...6=0x7F∧e7=1), the validity constraint only restricts B0 and B1 jointly, while the other bytes remain unaffected. Accordingly, bytes fall into three classes based on their position — U, B0 and B1, as defined in [4, Sec. 2.3].
2.3. The Valid-STL (VSTL) Distribution
The STL file format allows representing triangulated surfaces in a readable ASCII encoding or a compact binary encoding. We treat these representations as semantically equivalent and use the binary encoding for the subsequent analysis, converting ASCII content when necessary [4, Sec. 2.1]. Each triangle record contains a normal vector (3 floats, 12 bytes), three vertices (9 floats, 36 bytes), and an attribute word (2 bytes), for a total of 50 bytes. Throughout the rest of the paper a block is a string of triangle records.
We adopt assumptions (A1) and (A2) of [4, Sec. 2.3]. Assumption (A1) concerns format-preserving encryption [11], while (A2) confines dependence to the exponent pair (B0,B1) within each float.
We restrict our attention to the triangle records of the ciphertext; file metadata is outside the scope of the presented analysis.
Definition 1. For a fixed number of triangles T, the valid-STL (VSTL) distribution assigns equal probability to every valid STL file. Floats and attribute words are sampled independently and uniformly over their respective admissible encodings, giving 26T unconstrained bytes and 12T exponent pairs that form mutually independent groups.
2.4. Marginal and Joint Byte Distributions
The marginals for the three byte classes [4, Sec. 3] are
We reserve H∞ for the limiting value of H as the string length grows. For a source of independent uniform bytes H∞uniform=log2∣V∣=8 bits. Section 4.2 quantifies the reduction imposed by the validity constraint and establishes the corresponding entropy ceiling for the VSTL model.
This paper considers two entropy measures used to evaluate cryptographic systems. The global measure evaluates (8) on the entire ciphertext. The local measure [6] averages (8) over k non-overlapping blocks of NB bytes each. Sections 4 and 5, respectively, provide reference values, acceptance bounds and test procedures specific to the VSTL format.
3. Exact Entropy Statistics of a Valid STL File
This section derives the exact mean and variance of the block entropy under the VSTL distribution, accounting for the dependence within each exponent pair.
3.1. The Block Entropy as a Function of Its Histogram
The moments of the block entropy can be expressed in terms of the byte counts:
Since H is additive over byte values, only the one-dimensional and two-dimensional marginals of # ever appear. The counts are dependent — their sum is fixed at N and the validity constraint couples the two exponent bytes within every float — so the off-diagonal terms of (10) call for the joint law of (#(v0),#(v1)) and not for the product of their individual marginals. It remains to establish, under the VSTL model, how likely it is for a given value to appear a specified number of times in a block, and for two distinct values to appear specified numbers of times jointly.
3.2. Distributions of Individual and Joint Byte Counts
To count the occurrence of a given byte v at an unconstrained position, we define
ZU,v(bU)={1,0,bU=v,bU=v,bU∈V.(11)
ZU,v without an argument stands for ZU,v(BU), where BU is randomly drawn according to (3). Hence, ZU,v∼Bernoulli(PBU).
Likewise, to count the occurrences of a given byte v in an exponent pair, we define
ZX,v without arguments stands for ZX,v(B0,B1), where (B0,B1) is randomly drawn according to (7).
Let ΛX,v(m) denote the probability that exactly m∈{0,1,2} bytes of an exponent pair are equal to v. Its expression follows by inclusion-exclusion on the events B0=v and B1=v:
An additional argument generalizes the law to any number of independent groups. Specifically, ΛX,v(n,m) is the probability that n independent exponent pairs contribute a total of m occurrences of v. The n-fold convolution of (13) therefore admits the closed form
We extend this idea to the unconstrained positions and define ΛU,v(n,m) as the probability that n of them contribute a total of m occurrences of v. These contributions are independent and identically distributed Bernoulli variables (11), so ΛU,v(n,m) admits the binomial form
ΛU,v(n,m)=(mn)[PBU]m[1−PBU]n−m.(15)
Lemma 1. For every v∈V and every block of T records, the count #(v) is distributed as the convolution of ΛU,v over the 26T unconstrained positions with ΛX,v over the 12T exponent pairs.
To count the joint occurrences of two distinct bytes v0=v1, we evaluate (11) and (12) at each of the two values, accounting for the constraints a single group imposes on their co-occurrence.
Let ΛX,v0,v1(m0,m1) be the probability that a single exponent pair contributes m0 occurrences of v0 and m1 occurrences of v1. Each exponent pair holds only two bytes, so it is necessary that m0+m1≤2. Thus,
An additional argument again generalizes the law to any number of independent groups. Specifically, ΛX,v0,v1(n,m0,m1) is the probability that n independent exponent pairs contribute a total of m0 occurrences of v0 and m1 occurrences of v1. The n-fold convolution of (17) therefore admits the closed form
We extend this idea to the unconstrained positions as well and define ΛU,v0,v1(n,m0,m1) as the probability that n of them contribute a total of m0 occurrences of v0 and m1 occurrences of v1. A single unconstrained position carries only one value, so ZU,v0ZU,v1=0. The binomial form (15) therefore becomes trinomial over two equiprobable outcomes (3) and their complement:
Convolving the two families over their respective group counts gives the two-dimensional counterpart of Lemma 1.
Lemma 2. For all distinct v0,v1∈V and every block of T records, the pair of counts (#(v0),#(v1)) is jointly distributed as the two-dimensional convolution of ΛU,v0,v1 over the 26T unconstrained positions with ΛX,v0,v1 over the 12T exponent pairs.
The count laws of Lemmas 1 and 2 involve v, respectively (v0,v1), only through the marginals (3), (4), (5) and (7). The coarsest partition of V on which all four are constant is the set of categories
Γ={Vlo∗,{127},Vhi∗,{255}}.(21)
Any two bytes from the same category thus contribute equal terms to (9) and (10), as do any two pairs drawn from the same categories. The sums over individual bytes are therefore rewritten as sums over Γ, with each category weighted by its cardinality: 127 for either majority set, 1 for either minority byte.
For an arbitrary v∈γ, the two single-count moments of the category are
θγ=E[φ(N#(v))]=m∑φ(Nm)Pr[#(v)=m],
(22)
θγ(2)=E[φ(N#(v))2]=m∑φ(Nm)2Pr[#(v)=m].
(23)
For arbitrary v0∈γ0 and v1∈γ1 with v0=v1, the joint moment of the two categories is
PROOF. Assuming uniformity drops the validity constraint on the exponent pairs. All byte values are then equivalent, so the partition Γ reduces to a set of one category, that category being the alphabet V itself. Substituting this partition into (25) and (26) yields (27).
Equation (27) therefore reproduces the mean and variance of [6, Sec. 3.3].
4. The VSTL Global Entropy Test
Throughout this section we assume N grows without bound. Practical STL files justify this assumption: meshes usually run from thousands of triangles upwards, at fifty bytes per triangle. Although Proposition 1 provides exact reference moments at every file size, their direct evaluation through the nested sums in (22)–(24) becomes unnecessarily costly for large files.
What the global measure needs instead is the shape [4] gives to the differential statistics: a reference mean and a reference deviation in closed form, assembled in O(1) arithmetic operations at a fixed numerical precision, and turned into a critical value by a single quantile. This section derives both VSTL references in second-order asymptotic form, with an explicit O(N−3) error bound.
4.1. The Cross-Entropy Decomposition
The entropy (8) of a block is a function of its empirical byte distribution
QS(v)=N#(v),v∈V,(28)
so that H(S)=∑v∈Vφ(QS(v)).
Measured against a fixed probability law, the entropy splits into a cross-entropy and a divergence. The cross-entropy is linear in QS, hence a sum of T independent per-record terms, so its mean and its variance follow from the moments of a single record, in closed form and at every file size. The divergence, by contrast, holds the entire logarithmic nonlinearity in one nonnegative term; its moments cannot be obtained in closed form, and Section 4.3 approximates them by a Taylor expansion.
The law we measure against, and later expand around, is the record-average marginal
Pˉ=5026PBU+12PB0+12PB1.(29)
It is the average of the fifty per-position marginals of a record (3)–(5) and constant on the four categories (21):
For an arbitrary v∈γ, we write Pˉ(γ)=Pˉ(v) for the common value of the law on the category. Likewise for PBU, PB0 and PB1.
Pˉ(v) is the probability that a uniformly random position of a record holds the value v, and Pˉ is also the centre of the empirical distribution QS: linearity of expectation over the fifty positions of each record gives E[#(v)]=NPˉ(v), and hence E[QS]=Pˉ exactly, at every T. This is precisely what qualifies Pˉ as the point to expand around: relative to it, the divergence measures how far QS strays from the centre of its own fluctuations.
Lemma 3. Every block S of T records satisfies the identity
H(S)=v∈V∑QS(v)λ(Pˉ(v))−D(QS∥Pˉ),(31)
where
D(QS∥Pˉ)=−v∈V∑QS(v)λ(Pˉ(v)QS(v))(32)
is the Kullback–Leibler divergence in bits [12, Sec. 2.3].
PROOF. It is convenient to note a property of the surprisal function (8) first: the quotient rule of the underlying logarithm carries over, so differences of surprisals collapse to ratios of their arguments. For positive x and y,
By (30), ∀v∈V,Pˉ(v)>0; hence λ(Pˉ(v)) is finite and the ratio QS(v)/Pˉ(v) is well defined. Adding and subtracting λ(Pˉ(v)) inside each summand of (8) then gives
Terms with QS(v)=0 contribute nothing to H(S), since φ(0)=0; in the chain above, they likewise vanish because QS(v) multiplies every summand and carries its zero through. The identity is therefore applied only where both of its arguments are positive.
Write Cr for the score of the r-th record, namely, the surprisal its fifty bytes carry under Pˉ:
Cr=i=1∑50λ(Pˉ(Sr,i)),r=1,…,T.(35)
By Definition 1, the T records are i.i.d., and hence so are their scores. We denote the score of a generic record by C.
Averaged per byte over the block, the scores give back the cross-entropy term of (31), which we denote by CˉS,
Consequently, the moments of the block average score are
E[CˉS]Var[CˉS]=50E[C]=H(Pˉ),=50NVar[C],(38)
exactly and at every T.
PROOF. Write BU,r for the multiset of the unconstrained bytes and BX,r for the multiset of its exponent pairs of the r-th record. Regrouping the fifty terms of (35) along this split leaves the sum unchanged,
The same contribution can be computed while keeping the exponent pair (B0,B1) intact and evaluating it under its joint law PB0,1. This approach uses the fact that (5) and (4) are the marginals of (7), which Table 1 verifies. By extending the sum to V2 — with no change in value, since PB0,1 vanishes off X — and rearranging the resulting terms, we obtain the same expression:
Thus, for the mean, evaluating the pair jointly gives the same result as evaluating its two components through their marginal laws.
Since the T record scores in (36) have the common mean E[C], the expected value of the block-average score is
E[CˉS]=NTE[C]=50E[C]=H(Pˉ).(42)
Table 1: Verification that (5) and (4) are the marginals of (7). Each interior cell gives the probability mass contributed by the indicated partner categories. Zero indicates that (6) excludes every pair in that block. The entries in each row therefore sum directly to the stated marginal probability.
(a) PB0(v0)=∑v1∈VPB0,1(v0,v1)
v0
v1∈Vlo
v1∈Vhi
PB0(v0)
Vlo∗∪Vhi∗
65280128
65280128
2551
{127,255}
65280128
0
5101
(b) PB1(v1)=∑v0∈VPB0,1(v0,v1)
v1
v0∈Vlo∗∪Vhi∗
v0∈{127,255}
PB1(v1)
Vlo
65280254
652802
2551
Vhi
65280254
0
32640127
Variance. The 38 groups of (39) are the finest partition of a record into independent parts, and variances add over them and over no coarser split. Because validity couples the two bytes of every exponent pair, they must be treated jointly, with their contribution given by the variance of λ(Pˉ(B0))+λ(Pˉ(B1)), which does not equal the sum of the corresponding single-byte variances, as shown in (50) below. By the per-position marginals of Section 2.3, the 26 unconstrained groups and the 12 exponent pairs are identically distributed under (3) and (7), respectively, giving
Unlike the mean, the variance cannot be expressed in terms of Pˉ alone. The squared means in (44) are not linear in the three class marginals, so (29)
Table 2: The surprisal a byte carries under Pˉ, by category (21), from the probabilities (30).
Vlo∗
{127}
Vhi∗
{255}
λ(Pˉ(γ))
7.997286891460
8.182111941669
8.000000000000
8.185196272167
cannot fold them into Pˉ as it did in (40). Moreover, expanding the exponent pair's second moment introduces the cross term E[λ(Pˉ(B0))λ(Pˉ(B1))], which depends on the joint law (7), not on its marginals. The evaluation of the variance therefore requires computing the per-class moments and the moments of the exponent pair under its joint law.
By (3)-(5) and (30), the three marginals and the surprisal under Pˉ are constant on the categories (21), the values of the latter being reported in Table 2. Hence, for B∘∈{BU,B0,B1} and m=1,2,
The category partitioning thus reduces each expectation to four summands since all ∣γ∣ bytes of a given category contribute the same term.
For the exponent pair the weights must instead come from the joint law PB0,1. It is uniform on X by (7), and the surprisal depends on (v0,v1) only through their categories, so, to compute a pair moment, only the number of admissible pairs in each cell of Γ×Γ is needed:
The common denominator factors out, while nγ0γ1 gives the multiplicity of each category pair.
Table 3 reports the first and second moments of the unconstrained-byte and exponent-pair surprisals, required by the two variances in (44) and evaluated using (45) and (47). Substitution into (43) then gives
Var[C]≈0.011755404409.(48)
Since the T record scores in (36) are independent and have the common variance Var[C], the variance of the block-average score is
Var[CˉS]=N2TVar[C]=50NVar[C].(49)
Together with (42), this establishes (38).
Covariance within the exponent pair. To quantify the dependence within the exponent pair, we compute the covariance of its two byte-surprisal contributions:
Although the covariance is small, omitting it would overestimate Var[C] by approximately 0.000023553883, or 0.2%.
4.2. The Entropy Ceiling
Section 2 defines H∞ as the limit the block entropy attains as the string grows and gives H∞=8 bits for independent uniform bytes. For the VSTL source, if QS=Pˉ, then (31) reduces to H(S)=H(Pˉ), with D(QS∥Pˉ)=0. Lemma 4 shows that H(Pˉ) is also the exact mean of the cross-entropy term for every T, making it the candidate value of H∞VSTL. The following proposition establishes it.
Proposition 2. Let
H∞VSTL=H(Pˉ)≈7.99991479609.(51)
Then H(S)→H∞VSTL almost surely as T→∞. Moreover, at every T,
μVSTL(T)=H∞VSTL−E[D(QS∥Pˉ)]<H∞VSTL.(52)
The deficit from H∞, the entropy ceiling under the uniform-byte model, is
Δ=H∞−H∞VSTL≈0.00008520391bits.(53)
PROOF. For each v∈V, its counts in the T records are i.i.d. by Definition 1, bounded, and have common mean 50Pˉ(v) by (29). The strong law of large numbers [13, Sec. 7.5] gives QS(v)→Pˉ(v) almost surely for each v; since V is finite, these coordinatewise convergences hold simultaneously, and hence QS→Pˉ almost surely. The continuity of H on the probability simplex then gives H(S)=H(QS)→H(Pˉ)=H∞VSTL almost surely.
Taking expectations in (31) and using E[CˉS]=H(Pˉ) from Lemma 4 gives (52). Since the divergence is nonnegative and vanishes only at QS=Pˉ, its expectation is strictly positive, proving the inequality. Indeed, for every finite T, the empirical byte distribution is not fixed at Pˉ and therefore differs from it with positive probability.
Finally, Pˉ is nonuniform, so H(Pˉ)=H∞VSTL<H∞, and (53) follows.
One distinction remains: H∞VSTL is the limiting entropy of the empirical byte distribution, not the entropy rate of the VSTL source. Each record consists of the 26 uniform bytes and 12 exponent pairs in (39), so its entropy is
26λ(∣V∣1)+12λ(∣X∣1)=12λ(∣F∣1)+2λ(∣V∣1).(54)
Table 4: Entropies of the three byte marginals and the joint law of an exponent pair.
PBU
PB0
PB1
PB0,1
H(∙)
8
7.998275005486
7.999988906584
15.994353436859
The source entropy rate is therefore
hVSTL:=5026H(PBU)+12H(PB0,1).(55)
The marginal and joint entropies are reported in Table 4.
The first inequality is the concavity of H [12, Thm. 2.7.3], applied to Pˉ; the difference is approximately 0.000331457193 bits per byte. The second inequality is the independence bound [12, Thm. 2.6.6]. For each exponent pair, the difference between the sum of the marginal entropies and the joint entropy is the mutual information
Accumulated over all exponent pairs and normalized per byte, this gives the difference of approximately 0.000938514051 bits per byte between the two sides of the second inequality. Overall, the total gap is 0.001269971244 bits per byte, about fifteen times Δ.
These two differences explain why the limiting entropy of the empirical byte distribution differs from the source entropy rate. Reading (56) from right to left, the independence bound first replaces the joint law PB0,1 in hVSTL with its two marginals. Concavity then replaces the position-dependent marginals with their average Pˉ. Accordingly, hVSTL reflects both the dependence within exponent pairs and the differences among positional marginals, whereas H∞VSTL is the entropy of their pooled byte law Pˉ.
Because the global entropy statistic operates at this aggregate level, the analysis below uses H∞VSTL as its reference value rather than hVSTL.
4.3. Second-Order Expansions of the Reference Values
A Taylor expansion of H(S) about Pˉ relates fluctuations of the empirical byte distribution to the reference mean and variance. The decomposition established in Lemma 3 separates a linear cross-entropy score, whose moments are given by Lemma 4, from a divergence, which is expanded coordinatewise with a remainder that quantifies the approximation error. Each coordinate of the whole-file empirical distribution averages contributions from independent, identically distributed records, so the required expectations and covariances can be calculated from the joint moments for a single record.
The difference between the empirical byte distribution and its mean recurs throughout the expansion. For brevity, this fluctuation at any v∈V is abbreviated as
δS,v=QS(v)−Pˉ(v).(58)
For a given K≥2 and a function f with K+1 continuous derivatives between a and x, Taylor's formula with an integral remainder is
This identity follows from the fundamental theorem of calculus after K integrations by parts [14, Ch. 7].
Entropy is separable across byte values: each summand involves a single coordinate, so its Taylor expansion requires only the univariate derivatives of φ given by
As established earlier, the expansion point is the exact mean of the empirical byte distribution, so the deviations δS,v are centred. Furthermore, since every Pˉ(v) is positive, all derivatives in (61) are finite at the expansion point.
The linear term in (61) can now be simplified by substituting the expression for φ′(x) from (60):
The equation remains separable across byte values and expresses the nonlinear part of the entropy in powers of the per-coordinate deviations, beginning with their squares.
To determine an appropriate value for K so that the reference mean and variance are approximated with sufficient accuracy, we must first analyze the error left after truncating the expansion at that degree. For each coordinate, this error is RK,v. In the following calculations, its magnitude is shown to be bounded by a constant multiple of ∣δS,v∣K+1.
Substituting the formula for φ(K+1) from (60) into (62) gives
This expression is rewritten by parametrizing the line segment from Pˉ(v) to QS(v). This substitution allows us to factor out a power of the deviation δS,v, leaving an integral that can be bounded uniformly. The parameter runs from u=0 at the expansion point to u=1 at the empirical probability, giving
When QS(v)=0 and u=1, the ratio in (67) is undefined, but the integral can still be defined as an improper integral by approaching the upper integration endpoint from below [14, Sec. 10.23]. The resulting limit exists because, for QS(v)=0 and u∈[0,1), the ratio is constant at 1/Pˉ(v). Assigning this same value at u=1 therefore gives a continuous extension whose ordinary integral agrees with that limit.
The preceding argument establishes the following inequalities:
Combining this result with (67) gives the error bound
∣RK,v∣≤ln(2)KPˉ(v)K∣δS,v∣K+1.(69)
4.3.1. The Reference Mean
To proceed with the asymptotic analysis, we first require moments of the histogram deviations. Fix a byte v∈V and denote its count in the r-th record by Xv,r∈{0,…,50}. By Definition 1, these counts are i.i.d. across the T records, and their generic representative is denoted by Xv. Using the multisets BU,r and BX,r introduced in (39) and the counting functions ZU,v and ZX,v defined in (11) and (12), we obtain
Consequently, the moments of the histogram deviations can be expressed through moments of the centred record counts.
Raising the final identity in (74) to the k-th power yields a sum over k-tuples (r1,…,rk) of not necessarily distinct record indices, where each sum-mand is a product of the form X~v,r1⋯X~v,rk. Independence factorizes the expectation of each term, with each represented record contributing a centred moment of order equal to its multiplicity. Since E[X~v]=0, a term vanishes unless each of its constituent records has multiplicity at least two. For k≥2,
The integer ℓ is the number of distinct records represented in a surviving k-tuple, and the binomial coefficient (ℓT) counts the ways to select these ℓ records from the block. The integer ai is the multiplicity of the i-th selected record, and the multinomial coefficient (a1,…,aℓk) counts the corresponding arrangements.
Since every ai≥2 and a1+⋯+aℓ=k, at most ⌊k/2⌋ distinct records can be represented in an arrangement of the k factors. Consequently, the upper limit on ℓ in (75) also determines the asymptotic order
E[δS,vk]=O(N−⌈k/2⌉).(76)
Therefore, the deviation moments contributing through O(N−2) in the Taylor expansion are
Equations (69) and (76) now provide everything needed to choose an appropriate value for K so that the remainder bound has the required asymptotic order. The first equation involves an absolute moment and the second, a signed one; for odd K+1, the two are conceptually different: positive and negative deviations can cancel in the signed moment, whereas both contribute positively to the absolute moment. However, the two coincide when K+1 is even, so we choose the smallest such power whose moment is O(N−3), namely K+1=6, and hence fix K=5. For this choice, the resulting bound is
Substituting (77) into (64) determines the leading terms, while O(N−3) absorbs all remaining terms and, by (78), the remainder. Equation (52) then gives (73).
To compute the leading terms in (73), the moments of X~v must be evaluated. For the two group counts in (70), define the centred variables
Z~U,vZ~X,v:=ZU,v−E[ZU,v],:=ZX,v−E[ZX,v].
(79)
Taking expectations in (70) and subtracting the resulting identity from the original decomposition writes X~v as a sum of mutually independent centred variables. Squaring this sum and taking expectations leaves only the diagonal terms: every cross term vanishes because independence factorizes it into a product of zero means. Cubing the sum likewise leaves only the pure-cube terms: every mixed term contains at least one centred variable to the first power and therefore has zero expectation. Thus,
From the cross-entropy decomposition and the established expansion, the reference mean has been determined by taking expectations; taking variances instead expresses the reference variance as
The first term in (87) follows from Lemma 4. The covariance term is obtained from (64) with K = 5 by linearity of covariance, thereby separating the contributions of the polynomial part of the Taylor expansion from its remainder:
PROOF. We evaluate in turn all covariances and variances appearing in (88) and (89), retaining every contribution through order N−2.
We begin with the covariance between the score fluctuation and powers of the deviations of the empirical byte distribution. By (91), the score fluctuation is an average of centred record scores and therefore has expectation zero. Consequently, the covariance reduces to the product moment
Cov[CˉS,δS,vk]=E[δS,vk(CˉS−E[CˉS])].(93)
Substituting (74) and (91) into (93) yields a sum over (k+1)-tuples (r0,r1,…,rk) of not necessarily distinct record indices, where each summand is a product of the form C~r0X~v,r1⋯X~v,rk. Independence factorizes the expectation of each term; a record of multiplicity m contributes E[C~X~vm−1] when it is indexed by r0, and E[X~vm] otherwise. Since E[C~]=E[X~v]=0, a term vanishes unless r0 coincides with at least one of r1,…,rk and every other represented record occurs at least twice. For k≥2,
The index r0 identifies the record contributing C~. The integer ℓ is the number of additional distinct records represented among the k deviation factors, and the binomial coefficient (ℓT−1) counts the ways to select them from the remaining records. The integer b is the multiplicity of r0 among those factors, while ai is the multiplicity of the i-th additional record; the multinomial coefficient (a1,…,aℓ,bk) counts the corresponding arrangements.
Since b≥1 and every ai≥2, at most ⌊(k−1)/2⌋ additional records can be represented among the k deviation factors. Consequently, the upper limit on ℓ in (94) determines the asymptotic order
Cov[CˉS,δS,vk]=O(N−⌊k/2⌋−1).(95)
Therefore, the covariance terms contributing through O(N−2) in (88) are
We next consider the covariance between powers of the deviations at two byte values v0 and v1. The covariance is obtained by subtracting the product of the two marginal moments from their joint moment:
It remains only to evaluate the joint moment, since equations (75)–(77) already determine the product of the marginal moments in (97).
Substituting (74) for both deviations in E[δS,v0k0δS,v1k1] yields a sum over (k0+k1)-tuples of not necessarily distinct record indices, where each summand contains k0 factors associated with v0 and k1 factors associated with
v1. Independence factorizes the expectation of each term; a record represented a times among the factors associated with v0 and b times among those associated with v1 contributes the joint centred moment E[X~v0aX~v1b]. Since E[X~v0]=E[X~v1]=0, a term vanishes unless every represented record carries at least two factors in total. For k0,k1≥2, we have
The integer ℓ is the number of distinct records represented in a surviving (k0+k1)-tuple, and the binomial coefficient (ℓT) counts the ways to select them from the block. The integers ai and bi are the multiplicities of the i-th selected record among the factors associated with v0 and v1, respectively; the two multinomial coefficients count the corresponding arrangements within the two groups.
Since every ai+bi≥2 and their sum over all represented records is k0+k1, at most ⌊(k0+k1)/2⌋ distinct records can appear. Consequently, the upper limit on ℓ in (98) determines the asymptotic order
E[δS,v0k0δS,v1k1]=O(N−⌈(k0+k1)/2⌉)(99)
It follows from (76) and (99) that the product of the marginal moments is of no greater asymptotic order than the joint moment. Their difference (97) therefore obeys the same bound:
All remaining terms involve the Taylor remainder, whose variance provides the common bound needed for their analysis. Since R5,v is square-integrable, we may use the standard identity Var[Y]=E[Y2]−E[Y]2, which implies Var[Y]≤E[Y2]. Squaring (69) at K=5, taking expectations, and applying (76) with k=12 therefore determines the asymptotic order of Var[R5,v]:
The next term to be analyzed is the covariance between the score fluctuation and the remainder. The Cauchy–Schwarz inequality bounds the absolute value of the covariance between two random variables by the square root of the product of their variances [15, App. 10B]. Lemma 4 shows that Var[CˉS]=O(N−1); combining this with the bound for R5,v in (102) gives
Likewise, the same Cauchy–Schwarz inequality is applied to Cov[δS,v0k,R5,v1], with v0 indexing the deviation and v1 the remainder [15, App. 10B]. Equation (76), together with the general variance bound established above, shows that Var[δS,v0k]≤E[δS,v02k]=O(N−k); combining this with the bound for R5,v1 in (102) gives
The final remainder contribution in (89) is the variance of the sum of R5,v over all byte values. The finite-dimensional Cauchy–Schwarz inequality [14, Thm. 1.41] then bounds the squared sum before the expectation is taken:
Substituting the results from (96), (97), (77), and (101) into the expansions (88) and (89) determines all contributions through order N−2. Equations (95), (100), and (102)–(105) show that every remaining contribution is O(N−3) or smaller. Equation (87), together with Lemma 4, then gives (92).
To evaluate the mixed moments in (92), we first decompose the centred score C~r into contributions from the unconstrained bytes and exponent pairs of the r-th record, by analogy with (39) and (70):
C~U without an argument stands for C~U(BU), where BU is randomly drawn according to (3). Likewise, C~X without arguments stands for C~X(B0,B1), where (B0,B1) is randomly drawn according to (7). As a consequence,
E[C~]=26E[C~U]+12E[C~X].(107)
Together with the centred count decomposition from (79), this gives:
Independence factorizes moments combining contributions from unconstrained bytes with contributions from exponent pairs, and centring makes them vanish: for example, E[C~UZ~X,v]=E[C~U]E[Z~X,v]=0.
For a single unconstrained byte, the product of the occurrence indicators is given by
The two indicators coincide only when v0=v1=v, in which case ZU,v0ZU,v1=ZU,v, consistently with (81); when v0=v1, they are mutually exclusive and their product is zero. Taking expectations gives
When evaluating the double sum over (v0,v1) in (92), the two cases from (110), implicitly inherited by (111), apply as follows: the first on the diagonal, for equal target byte values, and the second off the diagonal, for distinct target byte values.
For an exponent pair, the product of the occurrence counts is given by
With one component of the exponent pair fixed, each conditional expectation in (115) averages the surprisal of the admissible values of the other component under Pˉ. The relevant row or column of (46) then supplies the required weights:
PROOF. Assume uniformity — then the validity constraint no longer couples the exponent bytes B0 and B1 in each float, so they become independent, while every byte marginal, along with Pˉ, coincides with PBU=L1. Thus, a block consists of N independent uniform bytes, and its entropy converges to H∞uniform=log2L=8. For finite N, however, concavity makes the plug-in entropy biased downward [12, Thm. 2.7.3], so its reference mean requires a correction, while its reference variance is determined by fluctuations in the byte counts.
Under this uniform model, for any v∈V, Xv∼Binomial(50,PBU), so E[Xv]=50PBU. Moreover, every byte contributes the constant surprisal
λ(PBU),giving C=50H∞uniform=E[C]. It follows that Var[C]=0 and C~=0; therefore, all moments containing C~ vanish.
Substituting the binomial moments of Xv into (73) yields the mean in (120). This expansion agrees, at the corresponding orders, with the results of Miller [7], Basharin [8, Eq. (3)], and, after conversion to bits, Harris [9, Eq. (14)].
For distinct byte values v0=v1, independence of the 50 uniform bytes gives the record-count covariance E[X~v0X~v1]=−50PBU2. Substituting this covariance and the binomial moments of Xv into (92) yields the variance in (120). After conversion to bits, this expansion agrees with Harris [9, Eq. (23)]; Basharin [8, Eq. (4)] likewise notes that the N−1 term vanishes for equiprobable symbols.
4.4. Normal Approximation and Acceptance Bounds
Corollary 3. As T→∞,
σVSTL(T)H(S)−μVSTL(T)DN(0,1),(121)
so, with Φ the standard normal distribution function, the two-sided acceptance interval for the global measure at significance level α is
μVSTL(T)±Φ−1(1−2α)σVSTL(T),(122)
where μVSTL(T) and σVSTL(T) are the reference values of Propositions 3 and 4.
PROOF. Collect the centred record counts into the vector X~⟨r⟩=⟨X~v,r⟩v∈V. These vectors are i.i.d. across records by Definition 1, and equation (74) holds simultaneously in all L=∣V∣ coordinates. The central limit theorem for i.i.d. summands [16], [13, Thm. (5.10.4)], in its multivariate form in RL [17, Ex. 2.18], therefore gives
(123) where Σ is the finite limiting covariance matrix formed from the per-record moments (108) already evaluated for Proposition 4.
For each v∈V, Pˉ(v)>0 and lies in the domain on which φ is smooth; therefore, entropy is differentiable at the expansion point. Since entropy is separable across byte values, the L entries of its gradient are the L evaluations of the one-variable derivative (60), exactly as in (61). Thus,
Because H is differentiable at Pˉ, the delta method [17, Thm. 3.1] transforms the multivariate convergence in (123) into a univariate normal limit. Its variance is the quadratic form ∇H(Pˉ)TΣ∇H(Pˉ), which projects the histogram covariance along the entropy gradient. Since H(S)=H(QS) and H(Pˉ)=H∞VSTL by Proposition 2, this gives
N(H(S)−H∞VSTL)DN(0,∇H(Pˉ)TΣ∇H(Pˉ)).(125)
To evaluate the limiting variance in (125), consider the inner product of the gradient (124) with the centred byte counts X~v for a generic record. This calculation follows an approach similar to (63):
The constant term in φ′(x) is eliminated because ∑v∈VXv=∑v∈VE[Xv]=50 and therefore ∑v∈VX~v=0.
Substituting the entries of Σ from (123) into the quadratic form and applying bilinearity allows it to be written in terms of the inner product in (126):
The first term in the numerator converges in distribution by (128); the mean expansion (73) with the coefficients (85) shows that the second term in the numerator is O(N−1/2) and therefore vanishes as T→∞; the leading term of (92) shows that the denominator converges to a positive constant:
Slutsky’s theorem [18], [13, Exercise (7.2.5)], applied to the numerator and denominator of (129), together with the scaling rule for normal distribu-tions [13, Example (4.4.4)], therefore yields
The central 1−α region of N(0,1) is bounded by ±Φ−1(1−α/2); applying these bounds to (121) gives (122).
4.5. The Test Procedure
The second-order expansion and the normal approximation become increasingly accurate as T grows. At small triangle counts, however, the remainder of the expansions is too large to neglect. Figure 1 shows the resulting errors decreasing over 1≤T≤200, motivating a finite lower limit for the test that neither asymptotic result specifies.
Figure 2 compares intervals centred on the exact and second-order reference means and bounded at one respective standard deviation on either side. The ratio of their intersection length to their union length equals approximately 99.1% at T = 100 and continues to increase, reaching 99.6% at T = 200. We therefore adopt T≥100 as an operational lower limit for the test.
Corollary 3 turns the reference values of Propositions 3 and 4 into a two-sided test for the entropy of a single ciphertext. Table 5 lists the resulting mean, variance and acceptance bounds at three significance levels for selected numbers of triangles.
Algorithm 1 applies the reference expansions of Propositions 3 and 4 and the acceptance interval of Corollary 3 to a single ciphertext.
4.6. Practical Significance
As T grows, the difference between the uniform and VSTL reference means approaches the deficit Δ of (53), while their variability decreases. We measure this separation in units of the uniform deviation to determine when the uniform reference becomes unreliable in practice. The crossing condition is
μuniform(T)−μVSTL(T)=zσuniform(T).(132)
(b)
(c)
Figure 1: Exact moments compared with the second-order VSTL expansions: (a) means; (b) variances; (c) absolute errors.
Figure 2: Comparison of the exact and second-order VSTL references: (a) intervals centred on the respective means, with dashed bounds at one standard deviation on either side; (b) percentage overlap between the intervals of (a).
Table 5: Second-order reference moments and two-sided acceptance bounds for the VSTL global entropy test.
T
α
μVSTL(T)
[σVSTL(T)]2
Hα−(T)
Hα+(T)
100
0.05
7.962810934102
0.000010661985
7.956411123567
7.969210744638
0.01
7.954400157351
7.971221710853
0.001
7.952066477668
7.973555390536
1000
0.05
7.996232777643
0.000000110852
7.995580219145
7.996885336141
0.01
7.995375170404
7.997090384883
0.001
7.995137216092
7.997328339194
2000
0.05
7.998074574860
0.000000028888
7.997741447349
7.998407702371
0.01
7.997636771098
7.998512378621
0.001
7.997515296736
7.998633852984
5000
0.05
7.999178896716
0.000000005186
7.999037746408
7.999320047024
0.01
7.998993393767
7.999364399666
0.001
7.998941923555
7.999415869878
10000
0.05
7.999546877923
0.000000001532
7.999470170620
7.999623585227
0.01
7.999446067438
7.999647688408
0.001
7.999418096254
7.999675659592
20000
0.05
7.999730844887
0.000000000500
7.999686997633
7.999774692140
0.01
7.999673219828
7.999788469945
0.001
7.999657231004
7.999804458769
50000
0.05
7.999841217500
0.000000000137
7.999818318352
7.999864116648
0.01
7.999811122918
7.999871312082
0.001
7.999802772784
7.999879662216
100000
0.05
7.999878007110
0.000000000058
7.999863127307
7.999892886914
0.01
7.999858451734
7.999897562487
0.001
7.999853025840
7.999902988381
200000
0.05
7.999896401679
0.000000000026
7.999886376210
7.999906427149
0.01
7.999883225979
7.999909577379
0.001
7.999879570209
7.999913233149
500000
0.05
7.999907438345
0.000000000010
7.999901293640
7.999913583050
0.01
7.999899362833
7.999915513856
0.001
7.999897122178
7.999917754512
1000000
0.05
7.999911117221
0.000000000005
7.999906819439
7.999915415003
0.01
7.999905468978
7.999916765464
0.001
7.999903901799
7.999918332642
Algorithm 1 VSTL global entropy test
Require: ciphertext S consisting of T triangles, with N=50T data bytes S1,…,SN; significance level α
Ensure: global entropy acceptance verdict under the VSTL reference
Solving (132) for T shows that the mean gap first exceeds one uniform standard deviation at T = 3824 and the two-sided α=0.05 acceptance half-width at T = 7495. Both thresholds lie within practically relevant file size ranges.
4.7. Monte-Carlo Validation
Following the simulation procedure of [4], we check whether samples from the VSTL distribution recover the global entropy reference moments.
For a fixed triangle count T, one trial draws a VSTL file according to Definition 1. Each of its 12T floats is sampled independently and uniformly from F, and each attribute word independently and uniformly from {0,…,216−1}. We compute the global entropy using (8) over the bytes of the triangle records. For each of the selected file sizes spanning 500≤T≤1000000, n=10000 independent trials are performed.
The resulting observations H1,…,Hn give the sample mean and unbiased sample variance,
μ^=σ^2=n1i=1∑nHi,n−11i=1∑n(Hi−μ^)2.
(133)
These estimators converge to the true moments as n grows, providing a numerical check on the second-order reference values of Propositions 3 and 4.
To compare the reference values and Monte-Carlo estimates on a common scale, we use the standardized displacement
ζ(x)=σVSTL(T)x−μVSTL(T),(134)
which expresses the difference between any x and the reference mean in reference standard deviations.
Figure 3 confirms agreement between the simulated and predicted VSTL reference values — the mean and standard deviation follow their theoretical curves within sampling error at every tested size. It also reveals the consequences of wrongly relying on the uniform byte null model for VSTL ciphertexts. The vertical lines at T = 3824 and T = 7495 mark the crossings derived in Section 4.6, where the mean difference equals one uniform standard deviation and the uniform 95% acceptance half-width, respectively. Beyond the second threshold, the lower acceptance bound of the conventional test, based on the uniform byte null model, exceeds the VSTL reference mean, making the test unsuitable even at practically relevant file sizes and reinforcing the need for the format-specific test proposed in this paper.
Figure 4 shows the absolute differences between the reference values and their estimates on a logarithmic scale; both decrease towards zero over the tested range, with no apparent persistent discrepancy.
5. The VSTL Local Entropy Test
The (k,NB)-local test selects k non-overlapping blocks of TB consecutive records from a ciphertext S, denoted by S1,…,Sk∈VNB, and averages their Shannon entropies:
Hˉk,NB(S)=k1i=1∑kH(Si).(135)
(b)
Figure 3: Global entropy under the VSTL and uniform null models: (a) reference values from the second-order expansions and Monte-Carlo estimates; (b) the standardized counterpart of (a), expressed in ζ-units.
Figure 4: Absolute difference between the reference values of the VSTL global entropy test and their corresponding Monte-Carlo estimates: ∣μVSTL(T)−μ^∣ (red stars) and ∣σVSTL(T)−σ^∣ (blue circles).
The conventional local entropy test evaluates the observed average against reference values derived under the uniform null model, which treats each block as a string of NB i.i.d. uniform bytes. The VSTL local entropy test, however, requires reference values that account for the validity constraint.
This section adapts the capacity energy criterion of [6] to determine the optimal block size NB∗ for the VSTL local entropy test and then derives the exact reference mean and variance of Hˉk,NB∗ at that block size.
Lemma 5. Let S1,…,Sk be pairwise disjoint blocks of TB consecutive records from a VSTL ciphertext. The average of their entropies has mean and variance
PROOF. Under Definition 1, records are independent, so blocks containing disjoint sets of records have independent entropies. Every block contains the TB records drawn from the same distribution, so its entropy has mean μVSTL(TB) and variance [σVSTL(TB)]2. Averaging the k entropies preserves this mean and divides the variance by k, giving (136).
5.1. The Optimal Block Size
The block size is determined by maximizing the capacity energy criterion of [6, Eq. (28)]. This criterion is the probability that every byte value occurs in a random block, divided by the block size NB:
f(NB)=NBPr[⋂v∈V{#(v)>0}].(137)
For the VSTL local entropy test, each block consists of TB triangle records, so NB=50TB. The probability that every byte value occurs at least once in a random block of size NB is calculated by inclusion-exclusion over the events of absence. All values in a subset A⊆V are absent from the block if and only if every byte lies outside A:
where fU and fX are the probabilities that an unconstrained byte lies outside A and that both bytes of an exponent pair lie outside A, respectively. The variables nlo,ε127,nhi and ε255 specify how many values from each category of Γ belong to A. The binomial coefficients count the selections from the majority sets.
Following [6, Eq. (31)], the optimal block size is obtained by maximizing the criterion of (137), evaluated using (141):
The capacity energy criterion is presented numerically near the maximum in Table 6 and graphically over a wider range in Figure 5.
5.2. The Reference Values
The second-order expansions of Propositions 3 and 4 become increasingly accurate as T→∞. However, the optimal local block size TB∗=39 lies well
Figure 5: The VSTL capacity energy criterion over 1≤TB≤100, evaluated at integer triangle counts. The vertical line marks the maximum at TB∗=39.
below the operational lower limit T≥100 adopted for the global test in Section 4.5. We therefore evaluate the exact count laws of Lemmas 1 and 2 once for TB∗; the resulting mean and variance determine the reference values for every admissible k, avoiding the truncation errors of the global reference approximations.
Proposition 1 is evaluated at TB∗=39, with 26TB∗=1014 unconstrained bytes and 12TB∗=468 exponent pairs. The count law of Lemma 1, (22) and (23) then give the following moments:
θγ
θγ(2)
Vlo∗
0.030920079164
0.001042319790
{127}
0.027790753117
0.000852720838
Vhi∗
0.030871842363
0.001039250977
{255}
0.027741945918
0.000849747236
(143)
Likewise, the count law of Lemma 2 and (24) give the joint moments for v0=v1, with rows indexed by γ0 and columns by γ1:
θγ0γ1
Vlo∗
{127}
Vhi∗
{255}
Vlo∗
0.000955712851
0.000859027963
0.000954222497
0.000857520016
{127}
0.000859027963
—
0.000857604860
0.000770677417
Vhi∗
0.000954222497
0.000857604860
0.000952734466
0.000856099227
{255}
0.000857520016
0.000770677417
0.000856099227
—
(144)
The table is symmetric, and its two singleton diagonal entries are empty because a singleton category admits no pair of distinct values.
Equations (25) and (26) assemble these moments into the exact block mean and variance. By Lemma 5, averaging over k blocks gives the VSTL counterparts of the reference values of [6, Tab. 3]:
PROOF. Assume uniformity — then Corollary 1 gives the exact mean and variance of each block. The k disjoint blocks remain independent, so averaging preserves their mean and divides their variance by k. Substituting (27) into (136) yields (146).
Equation (146) therefore reproduces the reference mean and variance for the local entropy statistic of [6, Secs. 3.3 and 4.3].
5.4. Normal Approximation and Acceptance Bounds
Unlike the global normal approximation of Corollary 3, which lets the number of records in a block grow, the local approximation considers a growing number of blocks at a fixed block size.
Corollary 5. Let S1,…,Sk be pairwise disjoint blocks of TB∗ consecutive records from a VSTL ciphertext. Their average entropy has reference mean μHˉVSTL and standard deviation σHˉVSTL given in (145). Then, as the block count k grows,
σHˉVSTLHˉk,NB∗(S)−μHˉVSTLDN(0,1),(147)
so the two-sided acceptance interval at level α is
μHˉVSTL±Φ−1(1−2α)σHˉVSTL.(148)
PROOF. By Lemma 5, the block entropies are independent and share the same distribution. Since the variance in (145) is finite and positive, the central limit theorem [16], [13, Thm. (5.10.4)] gives (147).
The central 1−α region of N(0,1) is bounded by ±Φ−1(1−α/2); applying these bounds to (147) gives (148).
Table 7: Exact reference moments and two-sided acceptance bounds for the VSTL local entropy test at TB∗=39, NB∗=1950.
k
α
μVSTLHˉ
σVSTLHˉ
Hˉα−
Hˉα+
30
0.05
7.903106732975
0.001576661860
7.900016532513
7.906196933436
0.01
7.899045521154
7.907167944796
0.001
7.897918684977
7.908294780972
50
0.05
7.903106732975
0.001221277025
7.900713073990
7.905500391960
0.01
7.899960931825
7.906252534125
0.001
7.899088088276
7.907125377673
100
0.05
7.903106732975
0.000863573266
7.901414160475
7.904799305475
0.01
7.900882315650
7.905331150300
0.001
7.900265122057
7.905948343892
250
0.05
7.903106732975
0.000546171690
7.902036256134
7.904177209816
0.01
7.901699887932
7.904513578018
0.001
7.901309540430
7.904903925520
500
0.05
7.903106732975
0.000386201705
7.902349791541
7.903863674408
0.01
7.902111943305
7.904101522645
0.001
7.901835925939
7.904377540010
700
0.05
7.903106732975
0.000326400015
7.902467000702
7.903746465248
0.01
7.902265982253
7.903947483697
0.001
7.902032705002
7.904180760948
1000
0.05
7.903106732975
0.000273085845
7.902571494554
7.903641971395
0.01
7.902403310453
7.903810155496
0.001
7.902208136702
7.904005329247
1500
0.05
7.903106732975
0.000222973659
7.902669712634
7.903543753315
0.01
7.902532390891
7.903681075059
0.001
7.902373032191
7.903840433759
2000
0.05
7.903106732975
0.000193100853
7.902728262258
7.903485203692
0.01
7.902609338140
7.903604127810
0.001
7.902471329457
7.903742136493
5.5. The Test Procedure
The block count may be chosen within 30≤k≤⌊TB∗T⌋. The lower bound follows the convention of [6] for the normal approximation, while the upper bound is the number of complete non-overlapping blocks available in a file of T triangles. By (136), increasing k reduces the standard deviation of the average, without changing its reference mean.
Corollary 5 turns the reference values of (145) into a two-sided test for the average entropy of k non-overlapping blocks from a single ciphertext. Table 7 lists the resulting mean, standard deviation and acceptance bounds at three significance levels for selected block counts.
Algorithm 2 applies the reference moments of (145) and the acceptance interval of Corollary 5 to a single ciphertext.
Algorithm 2 VSTL (k,NB)-local entropy test
Require: ciphertext S consisting of T triangles, with N=50T data bytes
S1,…,SN; block count 30≤k≤⌊39T⌋; significance level α
Ensure: (k,1950)-local entropy acceptance verdict under the VSTL reference
1: R← the starting positions of k non-overlapping and uniformly selected 1950-byte blocks
2: Hˉ←0
3: for i∈R do
4: Hi←0
5: #(v)←0 for all v∈V
6: for j←0 to 1949 do
7: #(Si+j)←#(Si+j)+1
8: end for
9: for v∈V such that #(v)>0 do
10: Hi←Hi−1950#(v)log21950#(v)▹ (8)
11: end for
12: Hˉ←Hˉ+kHi▹ (135)
13: end for
14: μ←7.903106732975▹ (145)
15: σ←k0.008635732664▹ (145)
16: Hˉ−←μ−Φ−1(1−α/2)σ; Hˉ+←μ+Φ−1(1−α/2)σ▹ (148)
17: return Hˉ−≤Hˉ≤Hˉ+
5.6. Practical Significance
The uniform reference of [6, Tab. 3] uses blocks of 1936 bytes, whereas the VSTL local entropy test requires blocks of 1950 bytes. We therefore compare the VSTL reference with the uniform references at both block sizes, as reported in Table 8.
We express each mean difference in units of the corresponding uniform standard deviation to quantify the separation from the VSTL reference and
Table 8: Uniform local entropy reference values at NB=1936 and NB=1950, compared with the VSTL reference, with crossing thresholds for the mean differences.
Uniform (NB=1936)
Uniform (NB=1950)
μHˉ
7.902469316647
7.903192345732
kσHˉ
0.008694225839
0.008628570032
μHˉVSTL−μHˉ
0.000637416328
−0.000085612757
σHˉ/σHˉVSTL
1.006773388890
0.999170582071
Crossing at one standard deviation
k≥187
k≥10158
Crossing at 95% acceptance half-width
k≥715
k≥39021
identify when the uniform reference becomes practically unsuitable:
Solving (149) for k with z=1 gives the crossing at one uniform standard deviation, while with z=Φ−1(0.975) it gives the crossing at the two-sided 95% acceptance half-width. The mean differences and corresponding crossings are also listed in Table 8.
Against the uniform reference at NB=1936, both crossings occur at block counts attainable within practically relevant file sizes; at NB=1950, the crossings occur at substantially larger block counts.
5.7. Monte-Carlo Validation
Following the simulation procedure of [4] and Section 4.7, we check whether samples from the VSTL distribution recover the local entropy reference moments.
For a fixed k, one trial draws a VSTL file according to Definition 1, consisting of k blocks of TB∗ triangle records each. We compute their average entropy using (135). By Lemma 5, this procedure is equivalent in distribution to selecting k disjoint blocks from a longer VSTL file. We use n=10000 independent trials at each of the selected block counts spanning 30≤k≤5000.
The trial averages give the sample mean μ^Hˉ and unbiased sample variance σ^Hˉ2 through (133). Standardization follows (134), using the exact local reference values μHˉVSTL and σHˉVSTL of (145).
The simulated mean and standard deviation agree with the exact VSTL predictions within sampling error across all tested block counts, as illustrated in Figures 6 and 7. In the comparison with the uniform reference at
(b)
Figure 6: Local entropy under the VSTL model, compared with the conventional uniform reference at NB=1936: (a) exact reference values and Monte-Carlo estimates; (b) the standardized counterpart of (a), expressed in ζ-units.
(b)
Figure 7: Local entropy under the VSTL model, compared with the uniform reference at NB=1950: (a) exact reference values and Monte-Carlo estimates; (b) the standardized counterpart of (a), expressed in ζ-units.
Figure 8: Absolute difference between the reference values of the VSTL local entropy test and their corresponding Monte-Carlo estimates: ∣μHˉVSTL−μ^Hˉ∣ (red stars) and ∣σHˉVSTL−σ^Hˉ∣ (blue circles).
NB=1936, the fixed difference between the means becomes increasingly pronounced as the acceptance intervals narrow for larger k. The vertical lines in Figure 6 mark the crossings derived in Section 5.6 and listed in Table 8; beyond the second crossing, the VSTL reference mean lies above the upper bound of the uniform 95% acceptance interval. For the uniform reference evaluated at the optimal block size for the VSTL local entropy test NB∗, the mean difference is smaller and the curves are substantially closer, as shown in Figure 7, with both crossing thresholds lying beyond the tested range.
Figure 8 shows the absolute differences between the reference values and their Monte-Carlo estimates on a logarithmic scale; both show an overall downward trend towards zero as the block count grows.
6. Conclusions
This paper introduced a two-sided hypothesis test for the global entropy under the VSTL null model and adjusted the established local entropy test to this setting. The reference values and acceptance bounds account for the IEEE-754 validity constraint and the resulting dependence between the exponent bytes of each float. Removing this validity constraint recovers the conventional uniform model.
The global entropy converges to approximately 7.99991479609 bits, with an expected value strictly below this limit for every finite sample size. The second-order expansions provide efficiently computable reference moments and retain a nonzero N−1 term in the variance, unlike the uniform case, where this term vanishes. The difference between the reference means becomes relevant at practical file sizes — at 3824 triangles it first exceeds one uniform standard deviation, while at 7495 triangles the VSTL reference mean first falls below the lower bound of the uniform 95% acceptance interval.
For local entropy, the capacity energy criterion increased the block size from the conventional 1936 bytes to 1950 bytes, corresponding to 39 triangles. The exact moments gave a reference mean of approximately 7.903106732975 bits and a standard deviation of approximately k0.008635732664 for the average over k disjoint blocks. The difference from the uniform reference at 1936 bytes is again practically relevant — at 187 blocks it first exceeds one uniform standard deviation, while at 715 blocks the VSTL reference mean first exceeds the upper bound of the uniform 95% acceptance interval; the reference at 1950 bytes is substantially closer, but still becomes unsuitable for larger numbers of blocks.
Monte-Carlo simulations confirm the global and local reference moments within sampling error in all tested cases.
We therefore recommend evaluating STL ciphers against the VSTL references derived in this paper. Acceptance indicates consistency with the stated null model in terms of entropy; it does not establish cryptographic security.
Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Funding
This work was supported by the Scientific Research Fund of Konstantin Preslavsky University of Shumen [grant number RD-08-91/02.02.2026].
Declaration of generative AI and AI-assisted technologies in the manuscript preparation process
Generative AI tools were used to assist in identifying related literature, improve the language and readability of the manuscript, proofread the text, review the mathematical derivations and validate the consistency of the reported results. The authors retain full responsibility for the correctness of this work.
References
[1] I. Gibson, D. Rosen, B. Stucker, M. Khorasani, Additive Manufacturing Technologies, 3rd Edition, Springer, Cham, Switzerland, 2021. doi:10.1007/978-3-030-56127-7.
[2] M. Yampolskiy, W. E. King, J. Gatlin, S. Belikovetsky, A. Brown, A. Skjellum, Y. Elovici, Security of additive manufacturing: Attack taxonomy and survey, Addit. Manuf. 21 (2018) 431–457. doi:10.1016/j.addma.2018.03.015.
[3] M. Szilvási-Nagy, G. Mátyási, Analysis of STL files, Math. Comput. Model. 38 (7–9) (2003) 945–960. doi:10.1016/S0895-7177(03)90079-3.
[4] T. Troev, B. Stoyanov, Adjusted NPCR and UACI reference values for STL files under IEEE-754 validity constraints, Mathematics 14 (14) (2026) 2633. doi:10.3390/math14142633.
[5] C. E. Shannon, A mathematical theory of communication, Bell Syst. Tech. J. 27 (3) (1948) 379–423. doi:10.1002/j.1538-7305.1948.tb01338.x.
[6] Y. Wu, Y. Zhou, G. Saveriades, S. Agaian, J. P. Noonan, P. Natarajan, Local Shannon entropy measure with statistical tests for image randomness, Inf. Sci. 222 (2013) 323–342. doi:10.1016/j.ins.2012.07.049.
[7] G. A. Miller, Note on the bias of information estimates, in: H. Quastler (Ed.), Information Theory in Psychology: Problems and Methods, Free Press, Glencoe, IL, USA, 1955, pp. 95–100.
[8] G. P. Basharin, On a statistical estimate for the entropy of a sequence of independent random variables, Theory Probab. Appl. 4 (3) (1959) 333–336. doi:10.1137/1104033.
[9] B. Harris, The statistical estimation of entropy in the non-parametric case, in: I. Csiszár, P. Elias (Eds.), Topics in Information Theory, Vol. 16 of Colloquia Mathematica Societatis János Bolyai, North-Holland, Amsterdam, The Netherlands, 1977, pp. 323–355.
[10] IEEE, IEEE standard for floating-point arithmetic, IEEE Std 754-2019 (Revision of IEEE Std 754-2008) (2019). doi:10.1109/IEEESTD.2019.8766229.
[11] M. Bellare, T. Ristenpart, P. Rogaway, T. Stegers, Format-preserving encryption, in: Selected Areas in Cryptography (SAC 2009), Vol. 5867 of Lecture Notes in Computer Science, Springer, Berlin, Heidelberg, Germany, 2009, pp. 295–312. doi:10.1007/978-3-642-05445-7_19.
[12] T. M. Cover, J. A. Thomas, Elements of Information Theory, 2nd Edition, Wiley-Interscience, Hoboken, NJ, USA, 2006. doi:10.1002/047174882X.
[13] G. R. Grimmett, D. R. Stirzaker, Probability and Random Processes, 3rd Edition, Oxford University Press, Oxford, UK, 2001.
[14] T. M. Apostol, Calculus, Volume I: One-Variable Calculus, with an Introduction to Linear Algebra, 2nd Edition, John Wiley & Sons, New York, NY, USA, 1967.
[15] A. Papoulis, S. U. Pillai, Probability, Random Variables, and Stochastic Processes, 4th Edition, McGraw-Hill, New York, NY, USA, 2002.
[16] J. W. Lindeberg, Eine neue herleitung des exponentialgesetzes in der Wahrscheinlichkeitsrechnung, Math. Z. 15 (1) (1922) 211–225. doi:10.1007/BF01494395.
[17] A. W. van der Vaart, Asymptotic Statistics, Cambridge Series in Statistical and Probabilistic Mathematics, Cambridge University Press, Cambridge, UK, 1998. doi:10.1017/CB09780511802256.
[18] E. E. Slutsky, Über stochastische asymptoten und grenzwerte, Metron 5 (3) (1925) 3–89.