FHERMA
L2 · OPERATIONMEASURED

Encrypted Signed Division

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

Create implementationSpecification

DESCRIPTION

Computes signed integer division a / b, truncating toward zero, with both operands encrypted.

Division has no homomorphic counterpart, so every realization approximates a reciprocal or iterates toward the quotient. Signedness adds the sign of the result and the direction of truncation, both of which depend on data nobody can inspect.

INTERFACE

encrypted_sdiv(
  in  ct     : Ciphertext  // the encrypted first operand
  in  ct_b   : Ciphertext  // the encrypted divisor
  out ct     : Ciphertext  // the encrypted result of the opcode
  ...               // anything else the realization needs — keys, context, encoding — is its own concern
)

PARAMETER SCHEMA

NAMETYPERANGE
word_maxinteger255 – 2^32
target_precisionnumber0.5 – 1

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

CORRECTNESS

01The quotient truncates toward zero, not toward negative infinity.
02Division by zero returns zero, as the EVM defines.
03The most negative value divided by minus one returns itself, as the EVM defines.
04The result matches the EVM definition of the opcode exactly, including its behaviour at the boundaries.

An opcode is exact by definition. Where the scheme is approximate, the precision threshold is what stands in for exactness, and it has to hold at every integer in range.

SECURITY PROPERTIES

Operands and result stay encrypted throughout. Nothing about the values may be observable through timing or control flow, which rules out any realization that branches on a decrypted intermediate.

ASSUMPTIONS

Operands are integers held exactly at the point of encryption.

REFERENCES

Encrypted Signed Division · FHERMA