1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Power/EM side-channel analysis module.
//!
//! This module provides statistical methodology for detecting power and electromagnetic
//! side-channel leakage in cryptographic implementations, using the same Bayesian
//! framework as timing analysis but adapted for power trace data.
//!
//! # Overview
//!
//! Power side-channel analysis uses TVLA-style (Test Vector Leakage Assessment)
//! fixed-vs-random methodology:
//!
//! - **Fixed class**: Traces captured with fixed input (e.g., all-zeros key)
//! - **Random class**: Traces captured with random inputs
//!
//! The module extracts statistical features from power traces and uses Bayesian
//! inference to determine if there's a detectable difference between classes.
//!
//! # Feature Families
//!
//! Three feature extraction methods are supported:
//!
//! - **Mean**: Per-partition mean (standard TVLA)
//! - **Robust3**: Median, 10th, and 90th percentiles (robust to outliers)
//! - **CenteredSquare**: Centered variance per partition (detects second-order leakage)
//!
//! # Example
//!
//! ```ignore
//! use tacet::power::{Dataset, Trace, Class, Config, analyze};
//!
//! // Load or create traces
//! let traces = vec![
//! Trace::new(Class::Fixed, vec![0.1, 0.2, 0.3, ...]),
//! Trace::new(Class::Random, vec![0.15, 0.25, 0.35, ...]),
//! // ...
//! ];
//!
//! let dataset = Dataset::new(traces);
//! let config = Config::default();
//! let report = analyze(&dataset, &config);
//!
//! println!("Leak probability: {:.1}%", report.leak_probability * 100.0);
//! ```
pub use analyze;
pub use ;
pub use ;
pub use ;
pub use ;