aescrypt_rs/aliases/mod.rs
1// src/aliases/mod.rs
2
3//! Global secure type aliases — secure-gate v0.5.5+
4//! Maximum overkill, minimal duplication, audit-perfect
5
6use secure_gate::{dynamic_alias, fixed_alias};
7
8// ─────────────────────────────────────────────────────────────────────────────
9// Core secrets — must stay separate
10// ─────────────────────────────────────────────────────────────────────────────
11fixed_alias!(Aes256Key, 32); // Used: session key, HMAC key, encryption
12fixed_alias!(Iv16, 16); // Used: public IV, session IV
13fixed_alias!(PlainTextBlock16, 16); // Used: decrypted blocks in stream
14fixed_alias!(Salt16, 16); // Used: PBKDF2/ACKDF salt
15
16// ─────────────────────────────────────────────────────────────────────────────
17// Overkill public-but-sensitive — auto-zeroed on drop
18// ─────────────────────────────────────────────────────────────────────────────
19fixed_alias!(EncryptedSessionBlock48, 48); // Perfect name — used in session.rs + decrypt_cbc_loop
20fixed_alias!(PrevCiphertextBlock16, 16); // Used in session.rs + stream/context.rs
21fixed_alias!(RingBuffer64, 64); // Used in stream/context.rs
22fixed_alias!(SessionHmacTag32, 32); // Used in session.rs + stream/utils.rs
23
24// ─────────────────────────────────────────────────────────────────────────────
25// Dynamic secrets
26// ─────────────────────────────────────────────────────────────────────────────
27dynamic_alias!(MasterKey, Vec<u8>);
28dynamic_alias!(Password, String);
29dynamic_alias!(Token, String);
30
31// Re-exported crypto primitives — users get them from the same `aliases::*` import
32pub use crate::crypto::hmac::{HmacSha256, HmacSha512};