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

Function Run_Gen_Protocol

FHEOffline/DistKeyGen.cpp:288–539  ·  view source on GitHub ↗

sk will become the share of the secret key * pk will become the global public key */

Source from the content-addressed store, hash-verified

286 * pk will become the global public key
287 */
288void Run_Gen_Protocol(FHE_PK& pk,FHE_SK& sk,const Player& P,int num_runs,
289 bool commit)
290{
291 CODE_LOCATION
292 const FHE_Params& params=pk.get_params();
293
294#ifdef VERBOSE_KEYGEN
295 double start,stop;
296 /***********************
297 * Step 1 *
298 ***********************/
299 start=clock();
300#endif
301
302 // First compute and commit to the challenge value
303 vector<unsigned int> e(P.num_players());
304 vector<octetStream> Comm_e(P.num_players());
305 vector<octetStream> Open_e(P.num_players());
306 Commit_To_Challenge(e,Comm_e,Open_e,P,num_runs);
307
308#ifdef VERBOSE_KEYGEN
309 cout << "Done Step 1 " << endl;
310
311 stop=clock();
312 cout << "\t\tTime = " << (stop-start)/CLOCKS_PER_SEC << " seconds " << endl;
313 start=clock();
314#endif
315
316 /***********************
317 * Step 2 *
318 ***********************/
319 vector< vector<octetStream> > seeds(num_runs, vector<octetStream>(P.num_players()));
320 vector< vector<octetStream> > Comm_seeds(num_runs, vector<octetStream>(P.num_players()));
321 vector<octetStream> Open_seeds(num_runs);
322
323 vector<PRNG> G(num_runs);
324 Commit_To_Seeds(G,seeds,Comm_seeds,Open_seeds,P,num_runs);
325
326#ifdef VERBOSE_KEYGEN
327 cout << "Done Step 2 " << endl;
328
329 stop=clock();
330 cout << "\t\tTime = " << (stop-start)/CLOCKS_PER_SEC << " seconds " << endl;
331 start=clock();
332#endif
333
334 /***********************
335 * Step 2.5 *
336 ***********************/
337
338 // Generate my random data
339 vector<DistKeyGen> keys(num_runs, {params, pk.p()});
340
341 vector< vector<Rq_Element> > a(num_runs, vector<Rq_Element>(P.num_players(),Rq_Element(params.FFTD(), evaluation, evaluation)));
342
343
344 for (int i = 0; i < num_runs; i++)
345 {

Callers 2

runMethod · 0.85
covert_key_generationMethod · 0.85

Calls 15

Commit_To_ChallengeFunction · 0.85
Commit_To_SeedsFunction · 0.85
Transmit_DataFunction · 0.85
Open_ChallengeFunction · 0.85
check_randomnessFunction · 0.85
get_paramsMethod · 0.80
Gen_Random_DataMethod · 0.80
sum_aMethod · 0.80
compute_bMethod · 0.80
compute_enc_dashMethod · 0.80
compute_encMethod · 0.80
sum_encMethod · 0.80

Tested by

no test coverage detected