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

Method Create_More

FHEOffline/EncCommit.cpp:196–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195template<class T,class FD,class S>
196void EncCommit<T,FD,S>::Create_More() const
197{
198 CODE_LOCATION
199 const FHE_Params& params=(*pk).get_params();
200
201 // Tweak by using p rather than p/2, as we do not center the ciphertexts
202 int rhoi=(int) (6*params.get_R());
203 bigint comm = active_mask(params.phi_m(), b, t);
204 bigint Bound1=m[0].get_field().get_prime()*comm;
205 bigint Bound2=comm;
206 bigint Bound3=rhoi*comm;
207 bigint UBound1=2*(Bound1-m[0].get_field().get_prime());
208 bigint UBound2=2*(Bound2-1);
209 bigint UBound3=2*(Bound3-rhoi);
210
211 int my_num=(*P).my_num();
212 /* First generate the good ciphertexts and messages for myself */
213 PRNG G;
214 G.ReSeed();
215 vector<Random_Coins> rc(t,params);
216 for (int i=0; i<t; i++)
217 { m[i].randomize(G,cond);
218 rc[i].generate(G);
219 (*pk).encrypt(c[i][my_num],m[i],rc[i]);
220 }
221
222 // Broadcast and receive ciphertexts "c"
223 vector< vector<octetStream> > ctx_c(t, vector<octetStream> ((*P).num_players()));
224 for (int i=0; i<t; i++)
225 { c[i][my_num].pack(ctx_c[i][my_num]);
226 (*P).Broadcast_Receive(ctx_c[i]);
227 for (int j=0; j<(*P).num_players(); j++)
228 { if (j!=my_num)
229 { c[i][j].unpack(ctx_c[i][j]); }
230 }
231 }
232
233 vector< vector<octetStream> > seeds(2*TT, vector<octetStream>((*P).num_players()));
234 vector< vector<octetStream> > Comm_seeds(2*TT, vector<octetStream>((*P).num_players()));
235 vector< octetStream > ctx_Delta((*P).num_players());
236 Ciphertext ctx_C(params);
237 vector<octetStream> Open_seeds(2*TT);
238 vector<PRNG> Gseed(2*TT);
239 vector<int> open(2*TT);
240 vector<Rq_Element> z(4,Rq_Element(params.FFTD(),polynomial,polynomial));
241 vector<octetStream> Comm_data((*P).num_players());
242
243 char filename[1024];
244 bool fail=true;
245 int iter=0;
246 while (fail && iter<M)
247 { fail=false;
248 // Now commit to seeds for the Delta's
249 cout << "\t Create_More : iteration number = " << iter << endl;
250 for (int i=0; i<2*TT; i++)
251 { for (int j=0; j<(*P).num_players(); j++)
252 { seeds[i][j].reset_write_head();
253 Comm_seeds[i][j].reset_write_head();

Callers

nothing calls this directly

Calls 15

Commit_To_SeedsFunction · 0.85
not_implementedClass · 0.85
numBitsFunction · 0.85
Create_Random_SeedFunction · 0.85
bad_enccommitClass · 0.85
check_normFunction · 0.85
get_paramsMethod · 0.80
ReSeedMethod · 0.80
quasi_encryptMethod · 0.80
closeMethod · 0.80
SetSeedMethod · 0.80
get_dataMethod · 0.80

Tested by

no test coverage detected