serverCalculate
The server receives the query data from the client and returns the corresponding value to the client.
int serverCalculate(
DG_TeeCtx *dgTeeCtx,
DG_Buckets *buckets
)
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
dgTeeCtx |
MPC context |
Context initialized in section DG_InitPsmOpts. |
Input |
buckets |
Internal bucket structure |
- |
Input |
Return Values
- Success: 0 is returned.
- Failure: The error code is returned.
Error Codes
Error Code |
Value |
Description |
Remarks |
|---|---|---|---|
DG_SUCCESS |
0 |
Success |
None. |
DG_FAILURE |
1 |
Communication failure |
None. |
DG_ERR_MPC_TEE_INVALID_NODE_INFO |
4503 |
Invalid TEE node information |
None. |
DG_ERR_MPC_TEE_INVALID_PARAM |
4501 |
Failed to verify the parameters. |
dgCfg is null or the dgTeeCtx double pointer is null. |
Dependency
- dgCfg depends on the MPC configuration in section DataGuard APIs for Configuring an Operation Set, and the configured dgCfg is used as the input parameter of this API.
- psmOpts depends on the successful initialization in section DG_InitPsmOpts of the function group for the PSM operator.
- #include "data_guard_mpc.h": required header file
Example
#include "data_guard_mpc.h"
// psmOpts is the result of the successful DG_InitPsmOpts call, and dgTee is the result of the successful initTeeMpcSql call.
// buckets is the output result of offlineCalculate.
int res = psmOpts.serverCalculate(dgTee, buckets);
if (rv != 0) {
return rv;
}
Call the initTeeCtx API using the psmOpts output of the successful DG_InitPsmOpts call.
Parent topic: PSM Operator