FHERMA
L3 · FUNCTIONALMEASURED

Encrypted Sigmoid

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

Create implementationSpecification

DESCRIPTION

Evaluates the logistic function

sigmoid(x) = 1 / (1 + exp(-x))

on an encrypted value, or on many at once.

The difficulty is that encrypted arithmetic offers additions and multiplications, and the exponential is neither. Every realization therefore approximates — by a polynomial, by a piecewise fit, or by a table lookup — and the interesting question is how much accuracy each approach buys per unit of depth and time. The kernel fixes the function and the accuracy demanded of it, and leaves the approach open.

Accuracy is not uniform across the input range: the curve is steepest near zero and flattest in the tails, so a benchmark case states the range it cares about.

INTERFACE

encrypted_sigmoid(
  in  ct     : Ciphertext  // an encrypted value — a single number or many
  out ct     : Ciphertext  // the encrypted result, sigmoid of each input value
  ...               // anything else the realization needs — keys, context, encoding — is its own concern
)

PARAMETER SCHEMA

NAMETYPERANGE
value_countinteger1 – 2^20
element_abs_maxnumber0.001 – 1000
target_precisionnumber0.5 – 1

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

CORRECTNESS

01Element i of the output encodes sigmoid of element i of the input.
02The result stays inside (0, 1); an approximation that overshoots the asymptotes is wrong even where it is close.
03Accuracy holds across the declared input range, not only near zero where the curve is easy.

The threshold belongs to the benchmark case; the requirement to meet it across the whole range belongs here.

SECURITY PROPERTIES

No secrecy requirement beyond that of the scheme in use. Evaluation never depends on a decrypted value, because it never has one.

ASSUMPTIONS

Inputs are already encrypted under parameters that leave enough depth for the approximation.

REFERENCES

Encrypted Sigmoid · FHERMA