Skip to main content

Operations

Inco Lightning provides arithmetic, comparison, and bitwise operations on encrypted values.

Arithmetic Operations

All arithmetic operations return an Euint128.

Example: Encrypted Addition

Comparison Operations

Comparison operations return an Ebool.

Bitwise Operations

CPI Context Pattern

All operations require a CPI context with the Inco Lightning program:
The last parameter in operation calls identifies whether the left-hand side operand is ciphertext (0) or plaintext (1). Always pass 0 when working with encrypted handles.