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

Method init

FHEOffline/PairwiseSetup.cpp:22–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21template <class FD>
22void PairwiseSetup<FD>::init(const Player& P, int sec, int plaintext_length,
23 int& extra_slack)
24{
25 cout << "Finding parameters for security " << sec << " and field size ~2^"
26 << plaintext_length << endl;
27 PRNG G;
28 G.ReSeed();
29
30 octetStream o;
31 if (P.my_num() == 0)
32 {
33 extra_slack =
34 generate_semi_setup(plaintext_length, sec, params, FieldD, true);
35 params.pack(o);
36 FieldD.pack(o);
37 o.store(extra_slack);
38 P.send_all(o);
39 }
40 else
41 {
42 P.receive_player(0, o);
43 params.unpack(o);
44 FieldD.unpack(o);
45 FieldD.init_field();
46 o.get(extra_slack);
47 }
48
49 alpha = FieldD;
50 alphai.randomize(G);
51 alpha.assign_constant(alphai);
52}
53
54template <class FD>
55void PairwiseSetup<FD>::secure_init(Player& P, PairwiseMachine& machine,

Callers

nothing calls this directly

Calls 12

generate_semi_setupFunction · 0.85
ReSeedMethod · 0.80
send_allMethod · 0.80
assign_constantMethod · 0.80
my_numMethod · 0.45
packMethod · 0.45
storeMethod · 0.45
receive_playerMethod · 0.45
unpackMethod · 0.45
init_fieldMethod · 0.45
getMethod · 0.45
randomizeMethod · 0.45

Tested by

no test coverage detected