negotiateSeeds
Negotiates seeds.
int negotiateSeeds ( DG_TeeCtx *dgTeeCtx, )
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
dgTeeCtx |
KCAL context |
Context initialized in section initTeeCtx. |
Input |
Return Values
- Success: 0 is returned.
- Failure: The error code is returned.
Error Codes
Error Code |
Value |
Description |
Remarks |
|---|---|---|---|
DG_ERR_MPC_TEE_INVALID_PARAM |
4501 |
Failed to verify the parameters. |
dgTeeCtx is null. The communication API is not registered. The node information is incorrect. |
DG_FAIL |
1 |
Failed to exchange the seeds. |
Failed to generate random numbers. Failed to exchange the seeds. |
Dependency
- dgTeeCtx depends on the context initialized in section initTeeCtx.
- Before exchanging the seeds, you need to call the setTeeNodeInfos API to set the information about all nodes.
- #include "data_guard_mpc.h": required header file
Example
#include "data_guard_mpc.h" /* Call setTeeNodeInfos before calling negotiateSeeds. dgTeeCtx is the context initialized by calling the initTeeCtx. */ rv = aritOpts.negotiateSeeds(dgTee, &allNodes);
Running result: res is 0.
Call the negotiateSeeds API using the aritOpts output of the successful DG_InitArithmeticOpts call.
Parent topic: Arithmetic Operators