pyecsca.sca.trace.test module

Provides statistical tests usable on groups of traces sample-wise (Welch’s and Student’s t-test, …).

welch_ttest(first_set, second_set, dof=False, p_value=False)[source]

Perform the Welch’s t-test sample wise on two sets of traces first_set and second_set.

Useful for Test Vector Leakage Analysis (TVLA).

Parameters:
  • first_set (Sequence[Trace]) –

  • second_set (Sequence[Trace]) –

  • dof (bool) – Whether to compute and return the degrees-of-freedom.

  • p_value (bool) – Whether to compute and return the p-values.

Return type:

Tuple[CombinedTrace, ...]

Returns:

Welch’s t-values (samplewise) (+ degrees-of-freedom, + p-values)

student_ttest(first_set, second_set)[source]

Perform the Students’s t-test sample wise on two sets of traces first_set and second_set.

Useful for Test Vector Leakage Analysis (TVLA).

Parameters:
  • first_set (Sequence[Trace]) –

  • second_set (Sequence[Trace]) –

Return type:

CombinedTrace

Returns:

Student’s t-values (samplewise)

ks_test(first_set, second_set)[source]

Perform the Kolmogorov-Smirnov two sample test on equality of distributions sample wise on two sets of traces first_set and second_set.

Parameters:
  • first_set (Sequence[Trace]) –

  • second_set (Sequence[Trace]) –

Return type:

CombinedTrace

Returns:

Kolmogorov-Smirnov test statistic values (samplewise)