Rate This Document
Findability
Accuracy
Completeness
Readability

DG_InitArithmeticOpts

Initializes the function group.

DG_Arithmetic_Opts DG_InitArithmeticOpts()

Parameters

None

Table 1 DG_Arithmetic_Opts structure

Member

Type

Description

initTeeCtx

Function pointer

int (*initTeeCtx)(DG_Cfg dgCfg, DG_TeeCtx **dgTeeCtx);

Initializes the KCAL object.

releaseTeeCtx

Function pointer

void (*releaseTeeCtx)(DG_TeeCtx **dgTeeCtx);

Releases the KCAL object.

setTeeNodeInfos

Function pointer

int (*setTeeNodeInfos)(DG_TeeCtx *dgTeeCtx, struct TeeNodeInfos *teeNodeInfos);

Sets the information about all nodes.

negotiateSeeds

Function pointer

int (*negotiateSeeds)(DG_TeeCtx *dgTeeCtx);

Negotiates seeds.

calculate

Function pointer

int (*calculate)(DG_TeeCtx *dgTeeCtx, DG_AlgorithmsType type, DG_MpcShareSet *shareSet, DG_MpcShare **share);

Performs calculations using an arithmetic operator.

makeShare

Function pointer

int (*makeShare)(DG_TeeCtx *dgTeeCtx, int isRecvShare, DG_TeeInput *input, DG_MpcShare **share);

Splits data into shares

revealShare

Function pointer

int (*revealShare)(DG_TeeCtx *dgTeeCtx, DG_MpcShare *share, DG_TeeOutput **output);

Reveals shares.

releaseShare

Function pointer

void (*releaseShare)(DG_MpcShare **share);

Releases share resources.

releaseOutput

Function pointer

void (*releaseOutput)(DG_TeeOutput **output);

Releases output resources.

Return Values

DG_Arithmetic_Opts: arithmetic operation set object.

Error Codes

None

Dependency

#include "data_guard_mpc.h": the header file where the API declaration is stored.

Example

#include  "data_guard_mpc.h" 
   
 DG_Arithmetic_Opts aritOpts = DG_InitArithmeticOpts();

This function initializes the KCAL arithmetic operators, which are all included in the DG_Arithmetic_Opts.