FHERMA
L2 · OPERATIONMEASURED

Encrypted XOR

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

Create implementationSpecification

DESCRIPTION

Computes the bitwise exclusive or of two encrypted integers.

The operation is a single gate on schemes that encrypt bits, and a decomposition problem on schemes that encrypt numbers: the operands have to be split into bits, combined, and recomposed. Which side of that divide an implementation sits on dominates its cost, and comparing the two is the point of having one kernel rather than two.

INTERFACE

encrypted_xor(
  in  ct     : Ciphertext  // the encrypted first operand
  in  ct_y   : Ciphertext  // the encrypted second operand
  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 result equals the bitwise exclusive or of the two operands.
02The operation is its own inverse: applying it twice with the same second operand returns the first.
03The 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 XOR · FHERMA