FHERMA
L3 · FUNCTIONALMEASURED

Encrypted Maximum

encrypted-max · spec v0.1.0 · 0 implementations · 6 runners

Create implementationSpecification

DESCRIPTION

Returns the maximum value held in an encrypted vector.

A maximum is a fold of pairwise comparisons, and each comparison is itself an approximation of a discontinuous function. Two costs therefore trade against each other: a linear scan is shallow but long, a binary tournament is short but deep, and which wins depends on the scheme and the vector length.

The kernel asks for the maximum value. Returning its position is a different capability and a different kernel, because an implementation may deliver one and not the other.

INTERFACE

encrypted_max(
  in  ct     : Ciphertext  // an encrypted vector of values
  out ct     : Ciphertext  // the encrypted maximum of those values
  ...               // anything else the realization needs — keys, context, encoding — is its own concern
)

PARAMETER SCHEMA

NAMETYPERANGE
value_countinteger1 – 2^16
max_valueinteger1 – 2^32
target_precisionnumber0.5 – 1
ties_presentbooleantrue, false

The schema belongs to the kernel. Each implementation declares which part of it it supports.

CORRECTNESS

01The output encodes the largest value present in the input.
02The result is correct when several elements share the maximum.
03Accuracy holds when the two largest values are close together, which is the case a weak comparison fails.

SECURITY PROPERTIES

Which element was largest must not be observable from the evaluation, only the value itself is returned.

ASSUMPTIONS

The vector is packed contiguously and its length is public.

REFERENCES

Encrypted Maximum · FHERMA