Rate This Document
Findability
Accuracy
Completeness
Readability

Calling an Arithmetic Operator

Arithmetic operators support two-party or three-party (some operators) operations. The nodes for two-party operations are set to compute nodes 0 and 1, and those for three-party operations are set to compute nodes 0, 1, and 2.

Two-Party Calling

  1. Configure KCAL settings, such as communication APIs and node information, through DataGuard APIs.
  2. Initialize the function group for arithmetic operators. This function group includes all the public APIs for arithmetic operators.
  3. Apply the settings to KCAL during initialization.
  4. Set the information about all nodes.
  5. Exchange seed information.
  6. Select the appropriate compute node and call its corresponding API.
    Compute node 0:
    1. Call the secret sharing API twice: once for receiving data shares of compute node 1, and again for splitting data of compute node 0 itself into shares and sending to compute node 1 the share size of compute node 0.
    2. Concatenate the data shares of both nodes in a specific order as input parameters for the calculate API.
    3. Call the calculate API to perform calculation based on the input operator type.
    4. Call the reveal API to obtain the final calculation output.
    Compute node 1:
    1. Call the secret sharing API twice: once for splitting data of compute node 1 itself into shares and sending the data shares to compute node 0, and again for receiving the share size of compute node 0.
    2. Use all the data shares as the input parameters of the calculate API.
    3. Call the calculate API to perform calculation based on the input operator type.
    4. Call the reveal API to obtain the final calculation output.

Three-Party Calling

  1. Configure KCAL settings, such as communication APIs and node information, through DataGuard APIs.
  2. Initialize the function group for arithmetic operators. This function group includes all the public APIs for arithmetic operators.
  3. Apply the settings to KCAL during initialization.
  4. Set the information about all nodes.
  5. Exchange seed information.

    Compute node 0:

    1. Call the secret sharing API twice. The API is the same as that in two-party calling.
    2. Concatenate the data shares of both nodes in a specific order as input parameters for the calculate API.
    3. Call the calculate API to perform calculation based on the input operator type.
    4. Call the reveal API to obtain the final calculation output.

    Compute node 1:

    1. Call the secret sharing API twice. The API is the same as that in two-party calling.
    2. Use all the data shares as the input parameters of the calculate API.
    3. Call the calculate API to perform calculation based on the input operator type.
    4. Call the reveal API to obtain the final calculation output.
    Compute node 2:
    1. Call the secret sharing API twice. The API is the same as that in two-party calling.
    2. Use all the data shares as the input parameters of the calculate API.
    3. Call the calculate API to perform calculation based on the input operator type.
    4. Call the reveal API to obtain the final calculation output.