1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
mod boxed;
pub mod locked_memory;
pub mod memories;
mod types;
pub mod utils;
pub use thiserror::Error as DeriveError;
pub use types::Bytes;
pub const DEBUG_MSG: &str = "Content of Locked Memory is hidden";
#[derive(Debug, DeriveError)]
pub enum MemoryError {
#[error("Encryption Error")]
EncryptionError,
#[error("Decryption Error")]
DecryptionError,
#[error("Illegal non-contiguous size")]
NCSizeNotAllowed,
#[error("Error while refreshing non-contiguous memory")]
NCRefreshError,
#[error("Lock unavailable")]
LockNotAvailable,
#[error("File System Error")]
FileSystemError,
#[error("Illegal zero-sized value provided")]
ZeroSizedNotAllowed,
#[error("Failed to allocate memory ({0})")]
Allocation(String),
#[error("Intended operation failed: ({0})")]
Operation(String),
#[error("Illegal tentative of using zeroized memory")]
IllegalZeroizedUsage,
}
pub trait ZeroizeOnDrop {}