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
- Configure KCAL settings, such as communication APIs and node information, through DataGuard APIs.
- Initialize the function group for arithmetic operators. This function group includes all the public APIs for arithmetic operators.
- Apply the settings to KCAL during initialization.
- Set the information about all nodes.
- Exchange seed information.
- Select the appropriate compute node and call its corresponding API.Compute node 0:
- 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.
- Concatenate the data shares of both nodes in a specific order as input parameters for the calculate API.
- Call the calculate API to perform calculation based on the input operator type.
- Call the reveal API to obtain the final calculation output.
Compute node 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.
- Use all the data shares as the input parameters of the calculate API.
- Call the calculate API to perform calculation based on the input operator type.
- Call the reveal API to obtain the final calculation output.
Three-Party Calling
- Configure KCAL settings, such as communication APIs and node information, through DataGuard APIs.
- Initialize the function group for arithmetic operators. This function group includes all the public APIs for arithmetic operators.
- Apply the settings to KCAL during initialization.
- Set the information about all nodes.
- Exchange seed information.
Compute node 0:
- Call the secret sharing API twice. The API is the same as that in two-party calling.
- Concatenate the data shares of both nodes in a specific order as input parameters for the calculate API.
- Call the calculate API to perform calculation based on the input operator type.
- Call the reveal API to obtain the final calculation output.
Compute node 1:
- Call the secret sharing API twice. The API is the same as that in two-party calling.
- Use all the data shares as the input parameters of the calculate API.
- Call the calculate API to perform calculation based on the input operator type.
- Call the reveal API to obtain the final calculation output.
Compute node 2:- Call the secret sharing API twice. The API is the same as that in two-party calling.
- Use all the data shares as the input parameters of the calculate API.
- Call the calculate API to perform calculation based on the input operator type.
- Call the reveal API to obtain the final calculation output.
Parent topic: Calling KCAL