Encrypted Sort

L4 · Application Components
sort · 1 specification · 0 implementations · no benchmarks yet
WHAT IT ISReturn an encrypted real array in non-decreasing order under CKKS.
CKKS
SIGNATURE
kernel sort<N: u32>(
%xs: secret<tensor<N x f64>>,
) -> %ys: secret<tensor<N x f64>>
Sizes and element types are left open here. A specification fixes them; an implementation says over which of them it works.
DESCRIPTION

Definition

Encrypted sort reorders a collection of encrypted values into a fixed order without revealing the individual values.

Given an encrypted vector

x=(x0,x1,,xN1),x = (x_0, x_1, \ldots, x_{N-1}),

the result is an encrypted vector yy that holds the same multiset of values in non-decreasing order:

y0y1yN1,y=π(x)y_0 \le y_1 \le \cdots \le y_{N-1}, \qquad y = \pi(x)

for some permutation π\pi. The output is a rearrangement of the input — no value is created, dropped, or altered beyond the numerical error of the scheme.

Mathematical Domain

Sorting is defined over a totally ordered element domain. The comparison that defines the order, the numeric type of the elements, and the direction of the ordering are properties of the domain, not of the kernel.

Because the data is encrypted, the ordering must be produced without branching on the secret values. A specification therefore typically requires the computation to be data-oblivious: the sequence of operations (the comparison network) is fixed in advance and independent of the values being sorted, so the control flow leaks nothing about the input.

The kernel does not fix the element domain, the cryptographic scheme, the length N, the ordering direction, or the correctness tolerance. These are defined by individual specifications.

Parameters Defined by Specifications

A specification narrows the general sort into a concrete computational problem by defining, for example:

  • the element domain and cryptographic scheme;
  • the length N;
  • the ordering direction (non-decreasing unless stated otherwise);
  • the input and output representation;
  • exact or approximate correctness and, when approximate, the accuracy tolerance;
  • whether the comparison network must be data-oblivious.

Applications

Sorting over encrypted data underpins private ranking and leaderboards, order-statistics such as median and percentiles, top-k selection, encrypted database ORDER BY, and preprocessing steps in privacy-preserving analytics and machine learning.

MAINTAINER
FM
fairmathreviews specifications · resolves disputes
USED BY · 0 KERNELS
Kernels above this one. If this kernel is wrong, or slow, they are wrong or slow with it.Nothing depends on this kernel yet.
BUILDS ON · 0 KERNELS
Kernels this one is stated in terms of. Not a call graph — a statement of dependence between problems.Nothing. This kernel sits at the bottom of the graph.
RECENT ACTIVITYNothing yet.