MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / forward

Method forward

FHE/P2Data.cpp:10–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10void P2Data::forward(vector<poly_type>& ans,const vector<gf2n_short>& a) const
11{
12 CODE_LOCATION_NO_SCOPE
13
14 int n=gf2n_short::degree();
15
16 BitVector bv(A.size());
17 ans.resize(A.size());
18 for (int i=0; i<slots; i++)
19 { word rep=a[i].get();
20 for (int j=0; j<n && rep!=0; j++)
21 { if ((rep&1)==1)
22 { int jj=i*n+j;
23 bv.add(A[jj]);
24 }
25 rep>>=1;
26 }
27 }
28 for (size_t i = 0; i < bv.size(); i++)
29 ans[i] = bv.get_bit(i);
30}
31
32
33void P2Data::backward(vector<gf2n_short>& ans,const vector<poly_type>& a) const

Callers 1

to_polyMethod · 0.45

Calls 5

sizeMethod · 0.45
resizeMethod · 0.45
getMethod · 0.45
addMethod · 0.45
get_bitMethod · 0.45

Tested by

no test coverage detected