Struct MemoryEncryption
pub struct MemoryEncryption {
config: EncryptionConfig,
active_key: RwLock<EncryptionKey>,
previous_keys: RwLock<HashMap<u64, EncryptionKey>>,
next_key_id: AtomicU64,
region_counter: AtomicU64,
stats: RwLock<EncryptionStats>,
last_rotation: RwLock<Instant>,
}Expand description
Memory encryption manager for GPU memory protection.
Fields§
§config: EncryptionConfig§active_key: RwLock<EncryptionKey>§previous_keys: RwLock<HashMap<u64, EncryptionKey>>§next_key_id: AtomicU64§region_counter: AtomicU64§stats: RwLock<EncryptionStats>§last_rotation: RwLock<Instant>Implementations§
§impl MemoryEncryption
impl MemoryEncryption
pub fn new(config: EncryptionConfig) -> MemoryEncryption
pub fn new(config: EncryptionConfig) -> MemoryEncryption
Create a new memory encryption manager.
pub fn encrypt_region(&self, plaintext: &[u8]) -> EncryptedRegion
pub fn encrypt_region(&self, plaintext: &[u8]) -> EncryptedRegion
Encrypt a memory region (demo/fallback implementation).
WARNING: Uses XOR-based simulation - NOT cryptographically secure.
Only for testing/development without the crypto feature.
pub fn decrypt_region(
&self,
region: &EncryptedRegion,
) -> Result<Vec<u8>, String>
pub fn decrypt_region( &self, region: &EncryptedRegion, ) -> Result<Vec<u8>, String>
Decrypt a memory region (demo/fallback implementation).
WARNING: Uses XOR-based simulation - NOT cryptographically secure.
pub fn rotate_keys(&self)
pub fn rotate_keys(&self)
Rotate encryption keys.
pub fn needs_rotation(&self) -> bool
pub fn needs_rotation(&self) -> bool
Check if key rotation is needed.
pub fn stats(&self) -> EncryptionStats
pub fn stats(&self) -> EncryptionStats
Get encryption statistics.
pub fn current_key_id(&self) -> u64
pub fn current_key_id(&self) -> u64
Get the current key ID.
pub fn config(&self) -> &EncryptionConfig
pub fn config(&self) -> &EncryptionConfig
Get the configuration.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MemoryEncryption
impl RefUnwindSafe for MemoryEncryption
impl Send for MemoryEncryption
impl Sync for MemoryEncryption
impl Unpin for MemoryEncryption
impl UnwindSafe for MemoryEncryption
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.