secure_gate/
lib.rs

1// ==========================================================================
2// src/lib.rs
3// ==========================================================================
4
5#![cfg_attr(not(feature = "zeroize"), forbid(unsafe_code))]
6#![doc = include_str!("../README.md")]
7
8extern crate alloc;
9
10// ── Core secret types (always available) ─────────────────────────────
11mod dynamic;
12mod fixed;
13
14pub use dynamic::Dynamic;
15pub use fixed::Fixed;
16
17// ── Non-cloneable wrappers (always available, zero-cost, pure) ───────
18mod no_clone;
19pub use no_clone::{DynamicNoClone, FixedNoClone};
20
21// ── Macros (always available) ────────────────────────────────────────
22mod macros;
23
24// // Re-export the macros at the crate root so users can just `use secure_gate::fixed_alias;`
25// pub use macros::{
26//     dynamic_alias, dynamic_generic_alias, fixed_alias, fixed_alias_rng, fixed_generic_alias,
27// };
28
29// ── Feature-gated modules (zero compile-time cost when disabled) ─────
30#[cfg(feature = "rand")]
31pub mod rng;
32
33#[cfg(feature = "conversions")]
34pub mod conversions;
35
36// ── Feature-gated re-exports ─────────────────────────────────────────
37#[cfg(feature = "rand")]
38pub use rng::{DynamicRng, FixedRng};
39
40#[cfg(feature = "conversions")]
41pub use conversions::{HexString, RandomHex, SecureConversionsExt};