Cryptographic Arithmetic Operators
The arithmetic operators include the cryptographic multiplication, comparison, division, sorting, summation, and averaging operators. These operators are used with the secret sharing and revealing features.
For details, see section "Arithmetic Operators" in KCAL Developer Guide. The following uses the cryptographic multiplication and comparison operators as examples to describe the principle.
- Each compute party uses its data shares and the shared seed as inputs (x0, y0, and the seed from P0, and x1, y1, and the seed from P1), and calls the KCAL multiplication operator to calculate and output z0 and z1, where z0 + z1 mod N = x × y mod N.
- Each compute party uses its data shares and the shared seed as inputs (x0, y0, and the seed from P0, and x1, y1, and the seed from P1), and calls the KCAL comparison operator to calculate and output z0 and z1, where z0 + z1 mod N = (x ≥ y) mod N.
- Each compute party uses its data shares and the shared seed as inputs (x0, y0, and the seed from P0, and x1, y1, and the seed from P1), and calls the KCAL addition or subtraction operator to calculate and output z0 and z1, where z0 + z1 mod N = (x + y) mod N or z0 + z1 mod N = (x – y) mod N, respectively.

- Each compute party uses its data shares and the shared seed as inputs (vector {xi0} and the seed from P0, and vector {xi1} and the seed from P1), and calls the KCAL maximum or minimum operator to calculate and output z0 and z1, where z0 + z1 mod N = MAX({xi}) mod N or z0 + z1 mod N = MIN({xi}) mod N, respectively.

- Each compute party uses its data shares and the shared seed as inputs (matrices x0 and y0 and the seed from P0, and matrices x1 and y1 and the seed from P1), and calls the KCAL matrix addition, subtraction, or multiplication operator to calculate and output z0 and z1, where z0 + z1 mod N = x + y mod N, z0 + z1 mod N = x – y mod N, or z0 + z1 mod N = x × y mod N, respectively.


- Each compute party uses its data shares and the shared seed as inputs (x0, y0, and the seed from P0; x1, y1, and the seed from P1; and x2, y2, and the seed from P2), and calls the KCAL three-party multiplication or comparison operator to calculate and output z0, z1, and z2, where z0 + z1 + z2 mod N = (x × y) mod N or z0 + z1 + z2 mod N = (x > y) mod N, respectively.

Parent topic: Key Features





