FHERMA
L3 · FUNCTIONALMEASURED

Encrypted ReLU

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

Create implementationSpecification

DESCRIPTION

Evaluates the rectified linear unit

ReLU(x) = max(0, x)

on an encrypted value, or on many at once.

ReLU is piecewise linear, which sounds easy and is not: the kink at zero is a discontinuity in the derivative, and encrypted arithmetic reaches it only through approximation. A realization that is accurate away from zero and wrong near it has solved the easy half of the problem, so the region around zero is where the accuracy requirement bites.

Because a network applies ReLU repeatedly, depth consumed per call matters as much as accuracy. Both are reported.

INTERFACE

encrypted_relu(
  in  ct     : Ciphertext  // an encrypted value — a single number or many
  out ct     : Ciphertext  // the encrypted result, ReLU 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
zero_includedbooleantrue, false

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

CORRECTNESS

01Element i of the output encodes max(0, x) for element i of the input.
02Negative inputs produce zero, not a small negative value; leakage below zero accumulates across layers.
03Accuracy holds in the neighbourhood of zero, where the function is not smooth.

SECURITY PROPERTIES

No secrecy requirement beyond that of the scheme in use. The sign of the input must not be observable from the evaluation.

ASSUMPTIONS

Inputs are encrypted under parameters leaving enough depth for the approximation.

REFERENCES

Encrypted ReLU · FHERMA