35 m_cCircuit(aby),
m_eContext(context), m_eMyRole(myrole), m_nShareBitLen(bitlen), m_eCirctype(circ) {
63 return m_nShareBitLen;
81 if (lvl < m_vLocalQueueOnLvl.size())
82 return m_vLocalQueueOnLvl[lvl];
94 if (lvl < m_vInteractiveQueueOnLvl.size())
95 return m_vInteractiveQueueOnLvl[lvl];
106 return m_vLocalQueueOnLvl.size();
114 return m_vInteractiveQueueOnLvl.size();
123 return m_vInputBits[party];
132 return m_vOutputBits[party];
141 return m_vInputGates[party];
150 return m_vOutputGates[party];
158 uint32_t GetNumGates() {
163 UGATE_T* GetOutputGateValue(uint32_t gateid);
164 uint32_t GetOutputGateValue(uint32_t gateid, UGATE_T*& outval);
165 template<
class T>
void GetOutputGateValue(uint32_t gateid, T& val);
166 uint32_t GetNumVals(uint32_t gateid) {
167 assert(gateid < m_cCircuit->GetGateHead());
173 virtual share* PutCONSGate(uint32_t nvals, UGATE_T val, uint32_t bitlen) = 0;
174 virtual share* PutCONSGate(uint32_t nvals, uint32_t* val, uint32_t bitlen) = 0;
175 virtual share* PutCONSGate(uint32_t nvals, uint8_t* val, uint32_t bitlen) = 0;
176 virtual uint32_t PutConstantGate(UGATE_T val, uint32_t nvals = 1) = 0;
179 virtual share* PutINGate(uint32_t nvals, uint64_t val, uint32_t bitlen,
e_role role) = 0;
180 virtual share* PutINGate(uint32_t nvals, uint32_t* val, uint32_t bitlen,
e_role role) = 0;
181 virtual share* PutINGate(uint32_t nvals, uint8_t* val, uint32_t bitlen,
e_role role) = 0;
196 virtual share* PutCallbackGate(
share* in, uint32_t rounds,
void (*callback)(
GATE*,
void*),
void* infos, uint32_t nvals) = 0;
199 share* PutRepeaterGate(uint32_t nvals,
share* ina);
202 template<
class T> uint32_t PutINGate(uint32_t nvals, T val) {
203 cout <<
"IN gate not implemented in super-class, stopping!" << endl;
207 template<
class T> uint32_t PutINGate(uint32_t nvals, T val,
e_role role) {
208 cout <<
"IN gate not implemented in super-class, stopping!" << endl;
217 virtual uint32_t PutINVGate(uint32_t parentid) = 0;
224 virtual void UpdateInteractiveQueue(uint32_t gateid) = 0;
225 virtual void UpdateLocalQueue(uint32_t gateid) = 0;
227 void UpdateInteractiveQueue(
share* gateid);
228 void UpdateLocalQueue(
share* gateid);
235 uint32_t m_nShareBitLen;
236 uint32_t m_nMaxDepth;
238 vector<deque<uint32_t> > m_vLocalQueueOnLvl;
239 vector<deque<uint32_t> > m_vInteractiveQueueOnLvl;
240 vector<deque<uint32_t> > m_vInputGates;
241 vector<deque<uint32_t> > m_vOutputGates;
242 vector<uint32_t> m_vInputBits;
243 vector<uint32_t> m_vOutputBits;
246 uint32_t m_nCONVGates;
249 uint32_t m_nRoundsAND;
250 uint32_t m_nRoundsXOR;
251 vector<uint32_t> m_nRoundsIN;
252 vector<uint32_t> m_nRoundsOUT;
254 const deque<uint32_t> EMPTYQUEUE;
276 vector<uint32_t>& get_gates() {
280 uint32_t get_gate(uint32_t shareid);
281 void set_gate(uint32_t shareid, uint32_t gateid);
282 void resize(uint32_t sharelen) {
283 m_ngateids.resize(sharelen);
286 void set_gates(vector<uint32_t> shares) {
291 return m_ngateids.size();
294 uint32_t max_size() {
298 uint32_t set_max_size(uint32_t maxsize) {
299 assert(maxsize >= m_ngateids.size());
300 m_nmaxbitlen = maxsize;
304 return m_ccirc->GetCircuitType();
308 return m_ccirc->GetContext();
312 template<
class T> T get_clear_value() {
313 assert(
sizeof(T) * 8 >= m_ngateids.size());
315 for (uint32_t i = 0; i < m_ngateids.size(); i++) {
316 val += (*m_ccirc->GetOutputGateValue(m_ngateids[i]) << i);
322 virtual uint8_t* get_clear_value() = 0;
323 virtual void get_clear_value_vec(uint32_t** vec, uint32_t *bitlen, uint32_t *nvals) = 0;
326 vector<uint32_t> m_ngateids;
328 uint32_t m_nmaxbitlen;
336 share(sharelen, circ) {
355 uint8_t* get_clear_value();
356 void get_clear_value_vec(uint32_t** vec, uint32_t *bitlen, uint32_t *nvals);
378 uint8_t* get_clear_value();
379 void get_clear_value_vec(uint32_t** vec, uint32_t* bitlen, uint32_t* nvals);
void Cleanup()
Definition: circuit.cpp:35
~arithshare()
Definition: circuit.h:374
arithshare(vector< uint32_t > gates, Circuit *circ)
Definition: circuit.h:368
deque< uint32_t > GetInteractiveQueueOnLvl(uint32_t lvl)
Definition: circuit.h:93
uint32_t GetMaxDepth()
Definition: circuit.h:70
deque< uint32_t > GetOutputGatesForParty(e_role party)
Definition: circuit.h:149
uint32_t GetShareBitLen()
Definition: circuit.h:62
uint32_t GetNumInputBitsForParty(e_role party)
Definition: circuit.h:122
share(uint32_t sharelen, Circuit *circ)
Definition: circuit.cpp:114
Definition: abycircuit.h:122
Definition: circuit.h:258
e_sharing m_eContext
Definition: circuit.h:232
virtual ~Circuit()
Definition: circuit.h:40
uint32_t GetNumLocalLayers()
Definition: circuit.h:105
uint32_t GetNumOutputBitsForParty(e_role party)
Definition: circuit.h:131
deque< uint32_t > GetInputGatesForParty(e_role party)
Definition: circuit.h:140
void Reset()
Definition: circuit.cpp:40
Circuit(ABYCircuit *aby, e_sharing context, e_role myrole, uint32_t bitlen, e_circuit circ)
Definition: circuit.h:34
~boolshare()
Definition: circuit.h:351
e_role
Defines the role of the party or the source / target for certain operations (e.g., input/output)
Definition: constants.h:139
Definition: circuit.h:332
void init(Circuit *circ, uint32_t maxbitlen=32)
Definition: circuit.cpp:125
~share()
Definition: circuit.h:272
arithshare(Circuit *circ)
Definition: circuit.h:363
e_circuit
Definition: constants.h:44
Definition: abycircuit.h:144
e_sharing
Enumeration which defines the different sharing which are there in the framework. ...
Definition: constants.h:124
void Init()
Definition: circuit.cpp:21
boolshare(uint32_t sharelen, Circuit *circ)
Definition: circuit.h:335
deque< uint32_t > GetLocalQueueOnLvl(uint32_t lvl)
Definition: circuit.h:79
uint32_t GetNumInteractiveLayers()
Definition: circuit.h:113
Definition: circuit.h:360
GATE * m_pGates
Definition: circuit.h:231
boolshare(vector< uint32_t > gates, Circuit *circ)
Definition: circuit.h:340