Expand description
Zero-cost secure wrappers for secrets — Fixed<T> for stack, Dynamic<T> for heap.
This crate provides explicit wrappers for sensitive data like CloneableArray, CloneableString, and CloneSafe, ensuring no accidental exposure.
See README.md for usage and examples.
Re-exports§
pub use cloneable::CloneSafe;pub use cloneable::CloneableArray;pub use cloneable::CloneableString;pub use cloneable::CloneableVec;pub use random::DynamicRandom;pub use random::FixedRandom;pub use encoding::hex::HexString;pub use encoding::base64::Base64String;pub use encoding::bech32::Bech32String;pub use crate::encoding::extensions::SecureEncodingExt;
Modules§
- cloneable
- Cloneable secret types (requires the
zeroizefeature). Provides wrappers that can be safely duplicated while maintaining security guarantees. Cloneable secret primitives for handling sensitive data that can be safely duplicated. - ct_eq
- Constant-time equality comparison (requires the
ct-eqfeature). Prevents timing attacks when comparing sensitive data. Provides the ConstantTimeEq trait for secure comparisons. Constant-time equality comparison for cryptographic secrets (gated behindct-eq). - encoding
- Encoding utilities for secrets (various encoding features available). Secure encoding/decoding with validation and zeroization. Encoding utilities for secure handling of encoded secret data.
- random
- Available macros (exported globally for convenience):
Macros§
- dynamic_
alias - Creates a type alias for a heap-allocated secure secret.
- dynamic_
generic_ alias - Creates a generic heap-allocated secure secret type alias.
- fixed_
alias - Creates a type alias for a fixed-size secure secret.
- fixed_
alias_ random - Creates a type alias for a random-only fixed-size secret.
- fixed_
generic_ alias - Creates a generic (const-sized) fixed secure buffer type.
Structs§
- Dynamic
- Re-export of the
Dynamictype. Heap-allocated secure secret wrapper. - Fixed
- Re-export of the
Fixedtype. Stack-allocated secure secret wrapper. - From
Slice Error - Re-export of the
FromSliceErrortype. Error for slice length mismatches in TryFrom impls.
Enums§
- Bech32
Encoding Error - Re-export of
Bech32EncodingErrorfor convenience when using bech32 encoding. Error type for Bech32 encoding operations.