Lune

USENIX Security2025顶会

Flexway O-Sort: Enclave-Friendly and Optimal Oblivious Sorting

Tianyao Gu, Yilei Wang, Afonso Tinoco, Bingnan Chen, Ke Yi, Elaine Shi

摘要

Oblivious algorithms are being deployed at large scale in real world to enable privacy-preserving applications such as Signal's private contact discovery. Oblivious sorting is a fundamental building block in the design of oblivious algorithms for numerous computation tasks. Unfortunately, there is still a theory-practice gap for oblivious sort. The commonly implemented bitonic sorting algorithm is not asymptotically optimal, whereas known asymptotically optimal algorithms suffer from large constants. In this paper, we construct a new oblivious sorting algorithm called flexway o-sort, which is asymptotically optimal, concretely efficient, and suitable for implementation in hardware enclaves such as Intel SGX. For moderately large inputs of 12 GB, our flexway o-sort algorithm outperforms known oblivious sorting algorithms by 1.32× to 28.8× when the data fits within the hardware enclave, and by 4.1× to 208× when the data does not fit within the hardware enclave. We also implemented various applications of oblivious sorting, including histogram, database join, and initialization of an ORAM data structure. For these applications and data sets from 8GB to 32GB, we achieve 1.44 ∼ 2.3× speedup over bitonic sort when the data fits within the enclave, and 4.9 ∼ 5.5× speedup when the data does not fit within the enclave. To the best of our knowledge, our flexway o-sort is the first concretely efficient algorithm that achieves optimality in both dimensions. Specifically, our flexway o-sort algorithm achieves (2.23 + o( 1 ))N log N work and (3 + o(1)) N B log M B N B number of page swaps where B denotes the page size, and M denotes the size of the EPC memory. Open-source implementation. We implemented our algorithm and evaluated their concrete performance. The core algorithm implementation (counting both oblivious sorting algorithms) has 1,600 lines of code. Although our implementation uses Intel SGX, the algorithm design should work for any common hardware enclave architecture. Our implementation has been made open source at https://github.com/odslib/ oblsort. Evaluation. We show that our algorithm achieves significant speedup over prior oblivious sorting algorithms for both the [EPC ≥ data] and [EPC < data] scenarios. For an array of 12 GB size, our speedup over prior algorithms is depicted in the following table where for the [EPC < data] scenario, we adopt an EPC size of 128 MB which is the same as SGXv1: Scheme Our speedup EPC ≥ data EPC < data Randomized Shellsort 28.8× 208× Bitonic (non-recursive impl.) 5.49× 38.4× Bitonic (recursive impl.) 1.32× 4.10× Multi-way bucket o-sort [43] 14.3× 12.4× We also implemented various applications that rely on oblivious sorting, including histogram, ORAM initialization, and database join. We measure the end-to-end application performance when using our flexway o-sort, and compare it with (recursive) bitonic sort as a baseline. For these applications, we achieve 1.44 ∼ 2.3× speedup when the data fits within the enclave, and 4.9 ∼ 5.5× speedup when the data does not fit within the enclave. Distribution o-sort. We also provide the distribution o-sort algorithm in Section B, which is a variant of our flexway o-sort algorithm that achieves optimal constant for the number of page swaps. Table 1 shows the performance of both our flexway o-sort and distribution o-sort algorithms in comparison with prior work. Additional result. As a byproduct, we also construct an oblivious shuffler, which randomly permutes an input array without leaking the permutation. Earlier works showed that the oblivious shuffler is also a versatile primitive in oblivious algorithms and ORAM schemes [45, 46, 30] . We give more detailed evaluation results on oblivious shuffler in Section 5.4. Technical Highlights Starting point: multi-way bucket o-sort. Ramachandran and Shi [43] constructed multi-way bucket o-sort, which is asymptotically optimal in both work and page swaps, but unfortunately suffers from astronomical constants. Their construction reduces the task of oblivious sorting N elements to an oblivious p-way MergeSplit, which can be viewed as a special sorting algorithm where the keys come from a small domain 0, 1, . . . , p -1. More precisely, a p-way MergeSplit accomplishes the following: Input: p bins each of size Z. Each bin contains real elements each marked with a key from 0, 1, . . . , p -1 and fillers. The frequency of each distinct key in the input is bounded by Z. Output: Route the real elements to p destination bins depending on their key, and each output bin is padded with fillers to its capacity Z. Ramachandran and Shi [43] showed that if we can achieve oblivious MergeSplit in O(n log n) cost where n = pZ, p = log N , and Z ∈ poly log N , then we can get oblivious sorting optimal in both work and number of page swaps.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • ObliDB: Oblivious Query Processing for Secure Databases 引用了 Oblix: An Efficient Oblivious Search Index
  • TENNOR: Trustworthy Execution for Neural Networks through Obliviousness and Retrievals 引用了 Telling Your Secrets without Page Faults: Stealthy Page Table-Based Attacks on Enclaved Execution
  • TENNOR: Trustworthy Execution for Neural Networks through Obliviousness and Retrievals 引用了 ObliDB: Oblivious Query Processing for Secure Databases
  • TENNOR: Trustworthy Execution for Neural Networks through Obliviousness and Retrievals 引用了 Oblix: An Efficient Oblivious Search Index
  • Oblix: An Efficient Oblivious Search Index 引用了 Telling Your Secrets without Page Faults: Stealthy Page Table-Based Attacks on Enclaved Execution
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper1

  1. TENNOR: Trustworthy Execution for Neural Networks through Obliviousness and RetrievalsZifan Qu, Vasileios P. Kemerlis, Giuseppe Ateniese, Evgenios M. KornaropoulosCCS 2026

它引用的 Paper10

  1. Telling Your Secrets without Page Faults: Stealthy Page Table-Based Attacks on Enclaved ExecutionJo Van Bulck, Nico Weichbrodt, Rüdiger Kapitza, Frank Piessens 等USENIX Security 2017 · 316 次引用
  2. Oblix: An Efficient Oblivious Search IndexPratyush Mishra, Rishabh Poddar, Jerry Chen, Alessandro Chiesa 等S&P 2018 · 200 次引用
  3. A Formal Foundation for Secure Remote Execution of EnclavesPramod Subramanyan, Rohit Sinha, Ilia A. Lebedev, Srinivas Devadas 等CCS 2017 · 146 次引用
  4. ObliDB: Oblivious Query Processing for Secure DatabasesSaba Eskandarian, Matei ZahariaVLDB 2020 · 127 次引用
  5. Path Oblivious Heap: Optimal and Practical Oblivious Priority QueueElaine ShiS&P 2020 · 36 次引用

相关 Paper

  1. Distributed & Scalable Oblivious Sorting and ShufflingNicholas Ngai, Ioannis Demertzis, Javad Ghareh Chamani, Dimitrios PapadopoulosS&P 2024 · 11 次引用
  2. EnigMap: External-Memory Oblivious Map for Secure EnclavesAfonso Tinoco, Sixiang Gao, Elaine ShiUSENIX Security 2023
  3. Efficient Oblivious Database JoinsSimeon Krastnikov, Florian Kerschbaum, Douglas StebilaVLDB 2020 · 57 次引用
  4. ZeroTrace : Oblivious Memory Primitives from Intel SGXSajin Sasy, Sergey Gorbunov, Christopher W. FletcherNDSS 2018 · 244 次引用
  5. SONIC: Concurrent Oblivious RAM & Data Structures for Low-Latency and High-ThroughputNihal Talur, Ioannis DemertzisUSENIX Security 2026
黄昏的海面,两侧是细线勾勒的悬崖