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: EncryptionConfigConfiguration
active_key: RwLock<EncryptionKey>Current active key
previous_keys: RwLock<HashMap<u64, EncryptionKey>>Previous keys for decryption
next_key_id: AtomicU64Next key ID
region_counter: AtomicU64Region counter
stats: RwLock<EncryptionStats>Statistics
last_rotation: RwLock<Instant>Last key rotation time
Implementations§
Source§impl MemoryEncryption
impl MemoryEncryption
Sourcepub fn new(config: EncryptionConfig) -> Self
pub fn new(config: EncryptionConfig) -> Self
Create a new memory encryption manager.
Sourcepub fn encrypt_region(&self, plaintext: &[u8]) -> EncryptedRegion
👎Deprecated since 0.4.3: Using insecure XOR-based demo encryption. Enable the crypto feature for real AES-256-GCM.
pub fn encrypt_region(&self, plaintext: &[u8]) -> EncryptedRegion
Using insecure XOR-based demo encryption. Enable the crypto feature for real AES-256-GCM.
Encrypt a memory region (demo/fallback implementation).
WARNING: Uses XOR-based simulation - NOT cryptographically secure.
Enable the crypto feature for real AES-256-GCM encryption.
Sourcepub fn decrypt_region(
&self,
region: &EncryptedRegion,
) -> Result<Vec<u8>, String>
👎Deprecated since 0.4.3: Using insecure XOR-based demo decryption. Enable the crypto feature for real AES-256-GCM.
pub fn decrypt_region( &self, region: &EncryptedRegion, ) -> Result<Vec<u8>, String>
Using insecure XOR-based demo decryption. Enable the crypto feature for real AES-256-GCM.
Decrypt a memory region (demo/fallback implementation).
WARNING: Uses XOR-based simulation - NOT cryptographically secure.
Enable the crypto feature for real AES-256-GCM decryption.
Sourcepub fn rotate_keys(&self)
pub fn rotate_keys(&self)
Rotate encryption keys.
Sourcepub fn needs_rotation(&self) -> bool
pub fn needs_rotation(&self) -> bool
Check if key rotation is needed.
Sourcepub fn stats(&self) -> EncryptionStats
pub fn stats(&self) -> EncryptionStats
Get encryption statistics.
Sourcepub fn current_key_id(&self) -> u64
pub fn current_key_id(&self) -> u64
Get the current key ID.
Sourcepub fn config(&self) -> &EncryptionConfig
pub fn config(&self) -> &EncryptionConfig
Get the configuration.