-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
42 lines (40 loc) · 1.56 KB
/
Copy pathlib.rs
File metadata and controls
42 lines (40 loc) · 1.56 KB
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
//! User-facing facade for Valv compile-time string protection.
//!
//! Valv exposes proc macros such as [`chacha!`] and [`aesgcm!`] that transform
//! string literals into encrypted byte blobs at compile time. At runtime the
//! returned [`SecretText`] decrypts only inside a closure, then drops a
//! zeroizing [`SecretStr`] wrapper.
//!
//! # Example
//!
//! ```
//! use valv::chacha;
//!
//! let host = chacha!("database.internal.example");
//! host.with_str(|value| assert_eq!(value, "database.internal.example"));
//! ```
//!
//! # Security Model
//!
//! Valv hides plaintext from naive static string extraction and reduces
//! plaintext lifetime in memory. It does not make embedded credentials
//! unrecoverable from a binary, because the program must contain enough material
//! to decrypt without external input. Use external runtime secrets for high-value
//! credentials.
#[cfg(feature = "timing_guard")]
pub use valv_core::TIMING_GUARD_MAX_GAP;
pub use valv_core::{engines, pulse, Encryptor, SecretStr, SecretText, ValvEngine, LICENSE};
#[cfg(feature = "runtime_bound")]
pub use valv_core::{RuntimeBoundError, RuntimeBoundText, MIN_RUNTIME_KEY_MATERIAL_LEN};
#[cfg(feature = "aesgcm")]
pub use valv_macros::{aesgcm, aesgcmex};
#[cfg(feature = "ascon")]
pub use valv_macros::{ascon, asconex};
#[cfg(feature = "runtime_bound")]
pub use valv_macros::{bound, boundex};
#[cfg(feature = "chacha")]
pub use valv_macros::{chacha, chachaex};
#[cfg(feature = "streammask")]
pub use valv_macros::{streammask, streammaskex};
#[cfg(feature = "xormask")]
pub use valv_macros::{xormask, xormaskex};