Encrypted Sorting
encrypted-sorting · spec v0.1.0 · 0 implementations · 6 runners
DESCRIPTION
Returns the elements of an encrypted array in ascending order.
A plaintext sort branches: it compares, then moves. Under encryption neither step is available — the comparison yields a ciphertext, and moving an element to a position determined by that ciphertext is itself a data-dependent access.
The workable shape is to compute, for each element, how many elements are smaller than it. That count is its destination index, it is obtained from pairwise differences passed through an approximate sign, and the permutation is then applied as an arithmetic combination rather than a move. The cost is quadratic in comparisons by construction, and every comparison is an approximation, so accuracy and depth compound.
An error here is not a small numeric error. A misplaced element is a wrong answer, which is why correctness is stated as a property of the permutation.
INTERFACE
encrypted_sort( in ct : Ciphertext // an encrypted array of values out ct : Ciphertext // the same values in ascending order ... // anything else the realization needs — keys, context, encoding — is its own concern )
PARAMETER SCHEMA
The schema belongs to the kernel. Each implementation declares which part of it it supports.
CORRECTNESS
Sorting is judged on the permutation, not on average numeric error: one element in the wrong place is a wrong answer even if every value is numerically close.
SECURITY PROPERTIES
The permutation applied must not be observable. An implementation whose data movement depends on the comparisons has revealed the ordering it was hiding.
ASSUMPTIONS
The array is packed contiguously and its length is public.