This library implements a basic key-value database where both keys and values are byte vectors. For each operation, the page access pattern is oblivious, meaning that an adversary cannot discern which key is accessed based on which disk page is accessed. The library is intended to run in a trusted execution environment (TEE). Compared to other oblivious map implementations, this library offers the following features:
- Low Latency: The Rust library is suitable for latency-sensitive applications, such as private block builders. (Benchmark details to be added.)
- Flexible Key and Value Sizes: The library does not require padding entries to a fix size. Instead, it accepts keys and values of varying sizes and can dynamically tune itself for optimal performance.
- Auto-scaling: There's no need to predefine a maximum database size before execution. The database automatically scales when full, and this scaling operation is fully de-amortized, ensuring no operation is blocked due to scaling.
- Enclave-friendly: A cache size can be configured based on the secure enclave memory space. Most data can be stored encrypted in external memory (e.g., SSD or HDD), with the library minimizing page swaps with insecure memory.
db.rs: Database interface.flexomap.rs: Oblivious Key-Value Map implementation using a cuckoo hash map to maintain the position of database entries.flexoram.rs: Non-recursive ORAM implementation for entries of varied sizes, storing actual database entries using a path ORAM eviction strategy.cuckoo.rs: Cuckoo hash map implementation that stores entries in two hash tables.recoram.rs: Recursive ORAM implementation for fix-size entries, used in the cuckoo hash map when the hash table cannot fit within the cache.fixoram.rs: Non-recursive ORAM for fix-size entries, also using a path ORAM eviction strategy. It is more efficient than flexoram due to the absence of fragmentation issues.dynamictree.rs: A multi-way ORAM tree implementation that scales dynamically. Each node in the tree is a page, and the tree's fan-out adjusts based on the number of entries each page can hold.segvec.rs: Implements a vector to store a level of the dynamic tree. When doubling the vector size, a new segment is allocated for the second half, avoiding the need to copy original data. Each new entry is initialized lazily on the next write operation for de-amortization.encvec.rs: Handles the encryption and decryption of each segment in thesegvec.params.rs: Global parameters.