18 #ifndef __ABYCIRCUIT_H_
19 #define __ABYCIRCUIT_H_
22 #include "../util/typedefs.h"
26 #include "../util/constants.h"
31 #define IsInteractive(gatetype, gatecontext) (!((gatecontext == C_ARITH && gatetype == G_ADD) || ((gatecontext == C_BOOL || gatecontext == C_YAO) && gatetype == G_XOR)) || (gatetype == G_MUL))
32 #define ComputeDepth(predecessor) ( (predecessor).depth + (predecessor).nrounds )
34 #define IsSIMDGate(gatetype) (!!((gatetype)&0x80))
71 void (*callback)(
GATE* gate,
void* infos);
131 uint32_t sharebitlen;
142 uint32_t FindBitLenPositionInVec(uint32_t bitlen,
non_lin_vec_ctx* list, uint32_t listentries);
156 uint32_t PutPrimitiveGate(
e_gatetype type, uint32_t inleft, uint32_t inright, uint32_t rounds);
157 uint32_t PutNonLinearVectorGate(
e_gatetype type, uint32_t choiceinput, uint32_t vectorinput, uint32_t rounds);
158 uint32_t PutCombinerGate(vector<uint32_t>& input);
159 vector<uint32_t> PutSplitterGate(uint32_t input);
160 uint32_t PutCombineAtPosGate(vector<uint32_t>& input, uint32_t pos);
161 uint32_t PutSubsetGate(uint32_t input, uint32_t* posids, uint32_t nvals);
162 uint32_t PutRepeaterGate(uint32_t input, uint32_t nvals);
163 vector<uint32_t> PutRepeaterGate(vector<uint32_t> input, uint32_t nvals);
164 uint32_t PutPermutationGate();
166 uint32_t PutOUTGate(uint32_t in,
e_role dst, uint32_t rounds);
167 vector<uint32_t> PutOUTGate(vector<uint32_t> in,
e_role dst, uint32_t rounds);
169 uint32_t PutINGate(
e_sharing context, uint32_t nvals, uint32_t sharebitlen,
e_role src, uint32_t rounds);
170 uint32_t PutConstantGate(
e_sharing context, UGATE_T val, uint32_t nvals, uint32_t sharebitlen);
171 uint32_t PutINVGate(uint32_t in);
172 uint32_t PutCONVGate(vector<uint32_t>& in, uint32_t nrounds,
e_sharing dst, uint32_t sharebitlen);
173 uint32_t PutCallbackGate(vector<uint32_t> in, uint32_t rounds,
void (*callback)(
GATE*,
void*),
void* infos, uint32_t nvals);
174 uint32_t GetGateHead() {
175 return m_nNextFreeGate;
178 uint32_t GetMaxVectorSize() {
179 return m_nMaxVectorSize;
182 void FinishCircuitGeneration();
188 inline void InitGate(
GATE* gate,
e_gatetype type, uint32_t ina, uint32_t inb);
189 inline void InitGate(
GATE* gate,
e_gatetype type, vector<uint32_t>& inputs);
192 inline void MarkGateAsUsed(uint32_t gateid, uint32_t uses = 1);
195 uint32_t m_nNextFreeGate;
196 uint32_t m_nSizeOfVal;
197 uint32_t m_nMaxVectorSize;
198 uint32_t m_nMaxGates;
Definition: abycircuit.h:66
e_gatetype
Enumeration which defines the type of the gate in the circuit.
Definition: constants.h:67
Definition: abycircuit.h:59
Definition: abycircuit.h:55
Definition: abycircuit.h:122
Definition: abycircuit.h:70
Definition: abycircuit.h:39
Definition: abycircuit.h:62
e_role
Defines the role of the party or the source / target for certain operations (e.g., input/output)
Definition: constants.h:139
Definition: abycircuit.h:51
Definition: abycircuit.h:144
e_sharing
Enumeration which defines the different sharing which are there in the framework. ...
Definition: constants.h:124
Definition: abycircuit.h:77
Definition: abycircuit.h:137