Calling the PIR Operator
- Configure KCAL settings, such as communication APIs and node IDs (node 0: server, and node 1: client), through DataGuard APIs.
- Initialize the function group for the PIR operator. This function group includes all the public APIs for the PIR operator.
- Apply the settings to KCAL.
- Set the information about all nodes.
- Select the appropriate compute node and call its corresponding API.Compute node 0 (server)
- Call the offlineCalculate function API to construct bucket data, which is used for query on the client in the online phase.
- Call the serverCalculate function API to respond to a query from the client and return a queried value.
Compute node 1 (client)- Once the offline calculation on the server is complete, call the clientCalculate function API and enter a key for query.
- Obtain the value corresponding to the key.
If either node (compute node 0 or 1) returns an error code when calling an API, the node needs to use a task scheduling mechanism to notify the other node to terminate the service process. For example, if compute node 1 returns an error code when calling the makeShare API and compute node 0 is waiting to receive shares, compute node 1, instead of the Software Development Kit (SDK) itself, needs to notify compute node 0 to stop receiving.
Parent topic: Calling KCAL