Skip to main content

arcanum_verify/
errors.rs

1//! Error types for verification operations.
2
3use thiserror::Error;
4
5/// Errors that can occur during verification.
6#[derive(Debug, Error)]
7#[allow(missing_docs)] // Error variant fields are self-documenting
8pub enum VerifyError {
9    /// Timing leak detected.
10    #[error("Timing leak detected: t-value {t_value:.2} exceeds threshold {threshold:.2}")]
11    TimingLeakDetected { t_value: f64, threshold: f64 },
12
13    /// Insufficient samples for statistical analysis.
14    #[error("Need at least {required} samples, got {provided}")]
15    InsufficientSamples { required: usize, provided: usize },
16
17    /// Test execution failed.
18    #[error("Test execution failed: {reason}")]
19    ExecutionFailed { reason: String },
20
21    /// Memory not properly zeroized.
22    #[error("Memory at offset {offset} not zeroized: expected 0x00, got 0x{actual:02X}")]
23    MemoryNotZeroized { offset: usize, actual: u8 },
24
25    /// Model checking property violation.
26    #[error("Property violation: {property}")]
27    PropertyViolation { property: String },
28
29    /// Report generation failed.
30    #[error("Report generation failed: {reason}")]
31    ReportGenerationFailed { reason: String },
32}
33
34/// Result type for verification operations.
35pub type VerifyResult<T> = Result<T, VerifyError>;