Inco exposes mathematical and logical operations over encrypted data. Note that for each operation that takes 2 arguments (i.e binary types below), you can use either an e-type or a regular variable as the first or second argument. Each operation returns a single e-type as result.

Under the hood, all operations are performing a call to the Inco contract singleton. The Inco contract checks access control rules and emits an event for each operation

Example usage

euint256 a = e.asEuint256(2);
euint256 b = e.asEuint256(3);
euint256 c = a.add(b); // c = 5 (encrypted)

Supported math operations

All these operations return an euint256.

NameFunctionType
Additione.addBinary
Subtractione.subBinary
Multiplicatione.mulBinary
Divisione.divBinary
Remaindere.remBinary
BitAnde.andBinary
BitOre.orBinary
BitXore.xorBinary
Shift Righte.shrBinary
Shift Lefte.shlBinary
Rotate Righte.rotrBinary
Rotate Lefte.rotlBinary

Supported comparison operations

NameFunctionTypeReturns
Equale.eqBinaryebool
Not equale.neBinaryebool
Greater than or equale.geBinaryebool
Greater thane.gtBinaryebool
Less than or equale.leBinaryebool
Less thane.ltBinaryebool
Mine.minBinaryeuint256
Maxe.maxBinaryeuint256
Note.notUnaryebool