Crates.io | mc-sgx-tstdc |
lib.rs | mc-sgx-tstdc |
version | 0.11.0 |
source | src |
created_at | 2023-01-30 22:29:38.989283 |
updated_at | 2024-03-22 20:18:55.407553 |
description | Rust wrappers around SGX synchronization primitives |
homepage | |
repository | https://github.com/mobilecoinfoundation/sgx |
max_upload_size | |
id | 772192 |
size | 21,400 |
Rust wrappers around SGX synchronization primitives.
The primitives exposed through this crate are low-level building blocks for higher-level constructs. Most people will want to use mc-sgx-sync to get std::sync compatible constructs.
The underlying implementation of [Mutex
], [RwLock
], and [Condvar
] make
OCALLs:
sgx_thread_wait_untrusted_event_ocall()
sgx_thread_set_multiple_untrusted_events_ocall()
sgx_thread_set_untrusted_event_ocall()
sgx_thread_setwait_untrusted_events_ocall()
These OCALLs are provided the waiting thread(s) and a return value to fill out. The OCALLs can suspend and or spuriously wake up trusted threads. The application (untrusted) inherently has control of whether the enclave thread(s) will execute. The OCALLs further increase the surface area that the application has in controlling the execution of enclave thread(s). Using these synchronization primitives, the application is now capable of stopping enclave thread(s) consistently at the synchronization points.