| 194 | |
| 195 | template<class T,class FD,class S> |
| 196 | void 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(); |
nothing calls this directly
no test coverage detected