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

Function Encrypt_Rq_Element

FHEOffline/DistKeyGen.cpp:15–26  ·  view source on GitHub ↗

* This creates the "pseudo-encryption" of the R_q element mess, * - As required for key switching. */

Source from the content-addressed store, hash-verified

13 * - As required for key switching.
14 */
15void Encrypt_Rq_Element(Ciphertext& c,const Rq_Element& mess, const Random_Coins& rc,
16 const FHE_PK& pk)
17{
18 auto c1 = pk.a() * rc.u() + rc.v() * pk.p();
19 auto c0 = pk.b() * rc.u();
20 auto edd = rc.w() * pk.p();
21
22 edd.change_rep(evaluation,evaluation);
23 add(edd,edd,mess);
24 add(c0,c0,edd);
25 c.set(c0,c1,pk);
26}
27
28
29void DistKeyGen::fake(FHE_PK& pk, vector<FHE_SK>& sks, const bigint& p, int nparties)

Callers 2

compute_enc_dashMethod · 0.85
check_randomnessFunction · 0.85

Calls 4

addFunction · 0.50
pMethod · 0.45
change_repMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected