Encrypted Sign Function
encrypted-sign · spec v0.1.0 · 0 implementations · 6 runners
DESCRIPTION
Evaluates sign(x) on an encrypted value — a single number or many at once — where
sign(x) = 1 if x > 0 sign(x) = 0 if x = 0 sign(x) = -1 if x < 0
The function is the foundation of encrypted comparison. Once sign(a - b) can be evaluated, the rest follows directly:
comp(a, b) = (sign(a - b) + 1) / 2 max (a, b) = ((a + b) + (a - b) · sign(a - b)) / 2
and from comparison and maximum come sorting, ranking and max-pooling. That makes it one of the most reused non-linear components in encrypted computation.
It is hard precisely because it is non-linear and discontinuous at zero, while encrypted arithmetic offers a restricted set of operations. The kernel therefore defines what the function is and how accurate the answer must be — nothing about how to get there.
The encryption scheme, the packing of elements into a ciphertext, the evaluation keys, the approximation strategy and the depth it consumes are all properties of an implementation, not of this kernel. A Chebyshev approximation under CKKS, a piecewise-linear one, a programmable bootstrap under TFHE and an exact arithmetic-circuit evaluation are all valid realizations, and comparing them is the entire point.
INTERFACE
encrypted_sign( in ct : Ciphertext // an encrypted value — a single number or many out ct : Ciphertext // the encrypted result, one sign per input value ... // 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
Where the arithmetic is approximate, correctness is a precision threshold rather than bit-exactness. The threshold belongs to the benchmark case; the requirement to meet it belongs here.
SECURITY PROPERTIES
The kernel adds no secrecy requirement of its own — security is whatever the parameters of the chosen scheme provide, and is declared per implementation. What the kernel does require is that evaluation never depends on a decrypted value, since it never has one.
ASSUMPTIONS
Whatever material the evaluation needs is generated honestly and supplied with the input; producing it is outside the operation and outside the measurement.