Documentation Index
Fetch the complete documentation index at: https://docs.inco.org/llms.txt
Use this file to discover all available pages before exploring further.
Operations
Inco Lightning provides arithmetic, comparison, and bitwise operations on encrypted values.Arithmetic Operations
All arithmetic operations return anEuint128.
| Function | Description | Signature |
|---|---|---|
e_add | Addition | (Euint128, Euint128) -> Euint128 |
e_sub | Subtraction | (Euint128, Euint128) -> Euint128 |
e_mul | Multiplication | (Euint128, Euint128) -> Euint128 |
e_rem | Remainder | (Euint128, Euint128) -> Euint128 |
Example: Encrypted Addition
Comparison Operations
Comparison operations return anEbool.
| Function | Description | Signature |
|---|---|---|
e_ge | Greater than or equal | (Euint128, Euint128) -> Ebool |
e_gt | Greater than | (Euint128, Euint128) -> Ebool |
e_le | Less than or equal | (Euint128, Euint128) -> Ebool |
e_lt | Less than | (Euint128, Euint128) -> Ebool |
e_eq | Equal | (Euint128, Euint128) -> Ebool |
Bitwise Operations
| Function | Description | Signature |
|---|---|---|
e_and | Bitwise AND | (Euint128, Euint128) -> Euint128 |
e_or | Bitwise OR | (Euint128, Euint128) -> Euint128 |
e_not | Bitwise NOT | (Euint128) -> Euint128 |
e_shl | Shift left | (Euint128, Euint128) -> Euint128 |
e_shr | Shift right | (Euint128, Euint128) -> Euint128 |
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.