oxirush_security/error.rs
1/// Security error types for oxirush-security.
2///
3/// Used for operations that can genuinely fail at runtime (e.g., invalid
4/// external key material in SUCI ECIES). Internal operations on fixed-size
5/// arrays use `.expect()` instead, since their sizes are compile-time guaranteed.
6
7#[derive(Debug, thiserror::Error)]
8pub enum SecurityError {
9 #[error("invalid key length: expected {expected}, got {got}")]
10 InvalidKeyLength { expected: usize, got: usize },
11 #[error("ECIES error: {0}")]
12 Ecies(String),
13 #[error("MAC verification failed")]
14 MacMismatch,
15}