pub mod global_rng;
pub mod rng;
pub mod secure_memory;
pub mod timing_safe;
pub mod zxcvbn_wrapper;
pub use global_rng::{GlobalRngStatistics, get_global_rng};
pub use rng::{RngStatistics, SecureRng};
pub use secure_memory::{MemoryProtection, SecureMemory, SecureString};
pub use timing_safe::TimingSafeOps;
pub use zxcvbn_wrapper::{MAX_PASSWORD_BYTES, MAX_PASSWORD_CHARS, zxcvbn_entropy_score};
#[derive(Debug, thiserror::Error)]
pub enum CryptoError {
#[error("Failed to obtain entropy source")]
EntropySourceFailure,
#[error("Insufficient entropy")]
InsufficientEntropy,
#[error("Requested size is too large")]
RequestTooLarge,
#[error("Reseed required")]
ReseedRequired,
#[error("RNG initialization error")]
RngInitError,
#[error("Memory security error: {0}")]
MemoryError(String),
#[error("Mutex poisoned: {0}")]
MutexPoisoned(String),
}
pub type CryptoResult<T> = std::result::Result<T, CryptoError>;