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

Method rerandomize

FHE/Ciphertext.cpp:121–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void Ciphertext::rerandomize(const FHE_PK& pk)
122{
123 Rq_Element tmp(*params);
124 SeededPRNG G;
125 vector<FFT_Data::S> r(params->FFTD()[0].phi_m());
126 bigint p = pk.p();
127 assert(p != 0);
128 for (auto& x : r)
129 {
130 G.get(x, params->p0().numBits() - p.numBits() - 1);
131 x *= p;
132 }
133 tmp.from(r, 0);
134 Scale();
135 cc0 += tmp;
136 auto zero = pk.encrypt(*params);
137 zero.Scale(pk.p());
138 *this += zero;
139}
140
141
142template void mul(Ciphertext& ans,const Plaintext<gfp,FFT_Data,bigint>& a,const Ciphertext& c);

Callers 2

second_phaseFunction · 0.80
addMethod · 0.80

Calls 7

numBitsMethod · 0.80
encryptMethod · 0.60
phi_mMethod · 0.45
pMethod · 0.45
getMethod · 0.45
fromMethod · 0.45
ScaleMethod · 0.45

Tested by

no test coverage detected