FHERMA
L3 · FUNCTIONALMEASURED

Encrypted Modulo

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

Create implementationSpecification

DESCRIPTION

Computes a mod b where both a and b are encrypted.

With a public modulus this is a scaling and a subtraction. With an encrypted one it is not: the quotient depends on data nobody can see, so a realization has to produce the remainder without ever branching on how many times b fits into a.

The kernel covers the general case. An implementation that only handles a public modulus is still a valid entry — it simply declares the narrower coverage, and is compared against cases inside it.

INTERFACE

encrypted_modulo(
  in  ct     : Ciphertext  // the encrypted dividend a
  in  ct_b   : Ciphertext  // the encrypted divisor b
  out ct     : Ciphertext  // the encrypted remainder a mod b
  ...               // anything else the realization needs — keys, context, encoding — is its own concern
)

PARAMETER SCHEMA

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

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

CORRECTNESS

01The output encodes the remainder of a divided by b, in [0, b).
02The result is exact for integer operands within the declared range.
03Behaviour is defined for a divisor of zero — either rejected by the declared coverage or documented.

SECURITY PROPERTIES

Neither operand may be revealed by the evaluation, and in particular the quotient must not be observable through timing or control flow.

ASSUMPTIONS

Operands are integers held exactly at the point of encryption.

REFERENCES

Encrypted Modulo · FHERMA