memsecurity 3.5.2

Securely hold secrets in memory and protect them against cross-protection-boundary readout via microarchitectural, via attacks on physical layout, and via coldboot attacks.
Documentation
/// Wraps `core::result::Result` with the `MemSecurityErr` as the `Err()` value
pub type MemSecurityResult<T> = Result<T, MemSecurityErr>;

/// Errors encountered in execution of the code in this crate
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
pub enum MemSecurityErr {
    /// An error was encountered while encrypting the data using Ascon128a  
    #[cfg(feature = "encryption")]
    EncryptionErr,
    /// An error was encountered when decrypting data using Ascon128a    
    #[cfg(feature = "encryption")]
    DecryptionError,
    /// The length of the arrays should be the same
    InvalidArrayLength {
        /// The length defined in generic value `N` in `const N: usize`
        expected: usize,
        /// The length of the mutable array `&mut [u8; N]`
        found: usize,
    },
    /// The length of the arrays should be the same
    InvalidSliceLength {
        /// The length defined in generic value `N` in `const N: usize`
        expected: usize,
        /// The length of the `&[u8]` slice
        found: usize,
    },
}