Skip to main content
Modules / Tools / Side-channel leakage assessment

Side-channel leakage assessment

Run a fixed versus random Welch t-test on side-channel traces or summary statistics, flag leaky points against the threshold, and size the traces needed.

Safety and securityFree to useHow it worksSourcesWhere it helps

Fills the inputs below with typical figures. Replace any of them with your own.

Data

Pick where the numbers come from. Example traces are seeded and synthetic; they teach the method and are not measurements of any device.

The same number of fixed and random traces.

How much one extra set bit adds to the trace in its window.

Available up to 12,000 samples in all. Reduce the points or the traces.

Test settings

4.5 is the usual value, about 7 in a million per point.

Second order needs traces, not a summary table.

How many traces

Sizing for an effect you want to be able to see.

0.1 is a small effect, 0.5 medium, 1 large.

First-order test
Leak at 2 points
Largest |t| 10.59 at point 15
First-order: df and p at the largest
973.5 df, p 7.13e-25
Expected false alarms for a leak-free device: 0.00027
Traces
500 fixed, 500 random
40 sample points
Traces to see an effect of 0.1
9,320 per group
18,640 in all, at power 0.99 and threshold 4.5. With your counts the smallest effect seen is 0.432
Chance of detecting that effect with your traces
0.2%
Expected t 1.58

Sign in to save your inputs and come back to them later.

First-order t value at each sample point
Line chart of t value against Sample point, 3 lines: t value, Threshold +4.5, Threshold −4.5. The same numbers are in the table under the chart.051010203040Sample pointt value
  • t value (solid line, circles)
  • Threshold +4.5 (dashed line, squares)
  • Threshold −4.5 (dotted line, triangles)
Show the data as a table
First-order t value at each sample point
Sample pointt valueThreshold +4.5Threshold −4.5
10.8584.5-4.5
2-1.284.5-4.5
3-0.8514.5-4.5
4-0.03584.5-4.5
5-0.1114.5-4.5
60.8674.5-4.5
7-0.7354.5-4.5
8-0.6584.5-4.5
90.5984.5-4.5
100.4354.5-4.5
11-0.2384.5-4.5
12-0.2644.5-4.5
130.5694.5-4.5
145.134.5-4.5
1510.64.5-4.5
163.224.5-4.5
170.4394.5-4.5
181.584.5-4.5
190.7464.5-4.5
20-2.324.5-4.5
21-0.5964.5-4.5
221.814.5-4.5
23-0.4754.5-4.5
241.734.5-4.5
25-1.74.5-4.5
260.8894.5-4.5
273.384.5-4.5
280.4694.5-4.5
291.944.5-4.5
300.6014.5-4.5
31-0.07884.5-4.5
32-1.014.5-4.5
33-0.5264.5-4.5
340.8854.5-4.5
35-1.014.5-4.5
36-0.4724.5-4.5
37-0.284.5-4.5
38-0.2674.5-4.5
39-1.214.5-4.5
40-1.144.5-4.5
Points above the threshold of 4.5
OrderPointtt in each setDegrees of freedomp-value
First1510.59one set973.57.13e-25
First145.13one set997.43.53e-7
Traces per group needed against the size of the effect
Line chart of Traces per group against Standardised effect, 3 lines: Power 0.5, Power 0.9, Power 0.99. The same numbers are in the table under the chart.010,00020,00030,0000.20.40.60.81Standardised effectTraces per group
  • Power 0.5 (solid line, circles)
  • Power 0.9 (dashed line, squares)
  • Power 0.99 (dotted line, triangles)
Show the data as a table
Traces per group needed against the size of the effect
Standardised effectPower 0.5Power 0.9Power 0.99
0.0516,20026,74237,280
0.14,0506,6869,320
0.151,8002,9724,143
0.21,0131,6722,330
0.34507431,036
0.4254418583
0.5162268373
0.783137191
1416794
Expected t against traces per group, effect 0.1
Line chart of Expected t against Traces per group, 2 lines: Expected t, Threshold 4.5. The same numbers are in the table under the chart.0246805,00010,00015,000Traces per groupExpected t
  • Expected t (solid line, circles)
  • Threshold 4.5 (dashed line, squares)
Show the data as a table
Expected t against traces per group, effect 0.1
Traces per groupExpected tThreshold 4.5
004.5
1,5602.794.5
3,1203.954.5
4,6804.844.5
6,2405.594.5
7,8006.244.5
9,3606.844.5
10,9207.394.5
12,4807.94.5
14,0408.384.5
15,6008.834.5
17,1609.264.5
18,7209.674.5
Traces per group by effect size and power
Standardised effectPower 0.5Power 0.9Power 0.99
0.0516,20026,74237,280
0.14,0506,6869,320
0.151,8002,9724,143
0.21,0131,6722,330
0.34507431,036
0.4254418583
0.5162268373
0.783137191
1416794

How it works

Test vector leakage assessment (TVLA) asks whether a device's power or electromagnetic trace depends on the data it handles, without attacking a key. It compares traces taken with one fixed input against traces taken with random inputs, sample point by sample point, with Welch's t-test. A |t| above 4.5 at any point is taken as evidence of leakage. This tool runs the test from summary statistics or from short pasted traces, adds the second-order test for masked designs, and tells you how many traces you need.

  1. Keep running moments, one pass. For each sample point the tool keeps the count, the mean and the central sums M2, M3 and M4 and updates them trace by trace, so no trace is stored twice and the numbers stay stable for very large campaigns. This is Welford's update, extended to the fourth moment.delta = x − mean; mean = mean + delta / n; M2 = M2 + delta x (x − mean new); sample variance = M2 / (n − 1)
  2. Welch's t-test per point. The fixed and random groups are compared at each point without assuming equal variances.t = (mean fixed − mean random) / sqrt(var fixed / n fixed + var random / n random)
  3. Degrees of freedom and p-value. The Welch-Satterthwaite formula gives the degrees of freedom. The two-sided p-value comes from the Student t distribution through the regularised incomplete beta function, which stays accurate far into the tail.df = (a + b)^2 / (a^2 / (n fixed − 1) + b^2 / (n random − 1)), where a = var fixed / n fixed and b = var random / n random; p = I(x; df / 2, 1/2) with x = df / (df + t^2)
  4. Second-order test. A well-masked design leaks nothing in the mean, but the spread of the trace can still depend on the secret. The second-order test centres each group's samples on its own mean and squares them, then applies the same Welch test to the squares. From the running sums, the mean of the squares is M2 / n and their variance is (M4 − M2^2 / n) / (n − 1).y = (x − mean)^2; mean of y = M2 / n; var of y = (M4 − M2^2 / n) / (n − 1)
  5. Decide. A point leaks when |t| is above the threshold, 4.5 by default, which corresponds to a two-sided p-value of about 7 in a million for each point. With two independent sets, a point counts only if both sets exceed the threshold with the same sign, which removes most chance alarms. The chance of at least one false alarm grows with the number of points, so the tool also gives the expected number of false alarms for an ideal device.false alarms expected = points x 2 x (1 − Phi(threshold)); two sets: points x (2 x (1 − Phi(threshold)))^2 / 2
  6. How many traces are needed. For a standardised effect d (the difference of the two means divided by the standard deviation) and equal groups, the average t grows with the square root of the group size. The traces needed per group to reach the threshold with a chosen power use the normal approximation. The smallest effect found with the traces you have follows from the same relation.traces per group = 2 x (threshold + z power)^2 / d^2; expected t = d / sqrt(1 / n fixed + 1 / n random); smallest effect = (threshold + z power) x sqrt(1 / n fixed + 1 / n random)

Assumptions

  • The fixed and random groups are acquired in an interleaved order, with the same set-up, so drift in the environment affects both groups alike.
  • At each sample point the readings in a group are independent and roughly normal, or the groups are large enough for the central limit theorem to hold. The second-order test needs far more traces than the first-order test for the same effect, because it works on squares.
  • Example traces are seeded and synthetic: a baseline, leakage proportional to Hamming weights in narrow windows, and Gaussian noise. They teach the method; they are not measurements of any device.
  • The sizing treats the effect as the standardised difference of means at one point, with equal group sizes, and uses the normal approximation to the t distribution.

Limits and warnings

  • A failed test shows that the traces depend on the data at some point. It does not show that a key can be recovered, and a passed test does not show that none can be. It is a screening step before attacks, not a certificate.
  • The test is univariate: each sample point on its own. Leakage spread across several points, for example a masked device whose shares sit at different times, needs a multivariate second-order test that this tool does not run.
  • The fixed-versus-random test is non-specific. It detects any data dependence, including that of harmless intermediate values. The standard ISO/IEC 17825 sets out the test vectors and the pass rules for a formal evaluation; this tool does not replace that process.
  • With thousands of points, even an ideal device will show some |t| above 4.5 now and then. Use two independent sets, or repeat the capture, before calling a point a leak.
  • The second-order test here uses sums from one set of traces and the group means estimated from the same traces; for very small groups its p-values are only a guide.

Sources

The methods and default figures rest on these public sources. The wording here is our own; read the source for its full text.

Where it helps

The lifecycle stages this tool serves: 2 stages in 1 lifecycle.

Method notev1Formula, ranges, sources and limits

Runs the fixed versus random Welch t-test for side-channel leakage and sizes the number of traces needed to detect a given effect at a stated power.

Formula

delta = x − mean; mean = mean + delta / n; M2 = M2 + delta x (x − mean new); sample variance = M2 / (n − 1); t = (mean fixed − mean random) / sqrt(var fixed / n fixed + var random / n random); df = (a + b)^2 / (a^2 / (n fixed − 1) + b^2 / (n random − 1)), where a = var fixed / n fixed and b = var random / n random; p = I(x; df / 2, 1/2) with x = df / (df + t^2); y = (x − mean)^2; mean of y = M2 / n; var of y = (M4 − M2^2 / n) / (n − 1); false alarms expected = points x 2 x (1 − Phi(threshold)); two sets: points x (2 x (1 − Phi(threshold)))^2 / 2; traces per group = 2 x (threshold + z power)^2 / d^2; expected t = d / sqrt(1 / n fixed + 1 / n random); smallest effect = (threshold + z power) x sqrt(1 / n fixed + 1 / n random)

Inputs
InputUnitRange it holds forComes from
Data sourcechoiceexample, summary, tracesYour figure
Example devicechoiceaes, maskedYour figure
Sample points in the examplepoints2 to 200Your figure
Traces per group in the exampletraces2 to 20000Your figure
Noise in the examplestandard deviation in trace unitsfrom 0Your figure
Leakage per bit in the exampletrace units per bitfrom 0Your figure
Thresholdabsolute t1 to 10Your figure
Standardised effect to detectstandard deviations0.001 to 5Your figure
Powerfraction0.5 to 0.9999Your figure

Outputs: Traces needed per group (traces); Traces needed in total (traces); Chance per point of exceeding the threshold with no leak (parts per million); Smallest effect found with the traces in each group (standard deviations); Largest absolute t value, first order (t).

Assumptions

  • The fixed and random groups are acquired in an interleaved order, with the same set-up, so drift in the environment affects both groups alike.
  • At each sample point the readings in a group are independent and roughly normal, or the groups are large enough for the central limit theorem to hold. The second-order test needs far more traces than the first-order test for the same effect, because it works on squares.
  • Example traces are seeded and synthetic: a baseline, leakage proportional to Hamming weights in narrow windows, and Gaussian noise. They teach the method; they are not measurements of any device.
  • The sizing treats the effect as the standardised difference of means at one point, with equal group sizes, and uses the normal approximation to the t distribution.

Uncertainty: The t statistics are exact for the data. The sizing is a normal approximation that is close for hundreds of traces or more; it assumes equal groups and an effect confined to one sample point.

Known limits

  • A failed test shows that the traces depend on the data at some point. It does not show that a key can be recovered, and a passed test does not show that none can be. It is a screening step before attacks, not a certificate.
  • The test is univariate: each sample point on its own. Leakage spread across several points, for example a masked device whose shares sit at different times, needs a multivariate second-order test that this tool does not run.
  • The fixed-versus-random test is non-specific. It detects any data dependence, including that of harmless intermediate values. The standard ISO/IEC 17825 sets out the test vectors and the pass rules for a formal evaluation; this tool does not replace that process.
  • With thousands of points, even an ideal device will show some |t| above 4.5 now and then. Use two independent sets, or repeat the capture, before calling a point a leak.
  • The second-order test here uses sums from one set of traces and the group means estimated from the same traces; for very small groups its p-values are only a guide.

Where the method comes from

Follows Leakage Assessment Methodology: A Clear Roadmap for Side-Channel Evaluations (Schneider and Moradi, CHES 2015) (opens in a new tab). The platform's version departs from it as follows.

  • The second-order test is univariate and works on the running central sums of a single set; the two-set confirmation rule and the trace-count sizing are added. Why: Masked designs need a higher-order test, and a team needs to know how many traces to capture.

Reference example, checked by test: Sizing worked by hand from the normal approximation: threshold 4.5, effect 0.1, power 0.99 (z = 2.326348): 2 x (4.5 + 2.326348)^2 / 0.1^2 = 9319.7, so 9,320 traces per group. The two-sided tail beyond 4.5 is 6.795 in a million. With 500 traces per group the smallest effect is (4.5 + 2.326348) x sqrt(2 / 500) = 0.4317. Traces needed per group 9,320; Traces needed in total 18,640; Chance per point of exceeding the threshold with no leak 6.795; Smallest effect found with the traces in each group 0.4317.

Versions

  • v1 (2026-10-25): First version, built from the tool idea.

All models in the register

Terms on this page

Test pattern
A sequence of input values and expected outputs applied to a chip by a tester to detect manufacturing faults or check a function.
ISO
The worldwide federation of national standards bodies that publishes consensus standards across industries, including the automotive functional safety and cybersecurity standards that govern semico...
IEC
The Geneva-based international standards organisation for electrical, electronic and related technologies, publishing everything from component symbols and safety requirements to functional safety...

The full glossary

Need help acting on this?

Tell us what you're after and leave your email: we'll connect you with the right person on the Hub.