Browse Source

Fixed the serialization bug for real this time.

Andrew Beams 2 years ago
parent
commit
e8a0ddd2b7
2 changed files with 3 additions and 3 deletions
  1. 1 1
      src/main.cpp
  2. 2 2
      src/pir_server.cpp

+ 1 - 1
src/main.cpp

@@ -122,7 +122,7 @@ int main(int argc, char *argv[]) {
     auto time_server_s = high_resolution_clock::now();
     // Answer PIR query from client 0. If there are multiple clients, 
     // enter the id of the client (to use the associated galois key).
-    PirReply reply = server.generate_reply(query, 0); 
+    PirReply reply = server.generate_reply(query2, 0); 
     auto time_server_e = high_resolution_clock::now();
     auto time_server_us = duration_cast<microseconds>(time_server_e - time_server_s).count();
     cout << "Main: reply generated" << endl;

+ 2 - 2
src/pir_server.cpp

@@ -128,7 +128,7 @@ void PIRServer::set_galois_key(uint32_t client_id, seal::GaloisKeys galkey) {
 PirQuery PIRServer::deserialize_query(stringstream &stream) {
     PirQuery q;
 
-    for (uint32_t i; i < pir_params_.d; i++) {
+    for (uint32_t i = 0; i < pir_params_.d; i++) {
         // number of ciphertexts needed to encode the index for dimension i
         // keeping into account that each ciphertext can encode up to poly_modulus_degree indexes
         // In most cases this is usually 1.
@@ -141,7 +141,7 @@ PirQuery PIRServer::deserialize_query(stringstream &stream) {
           cs.push_back(c);
         }
 
-        q.emplace(q.begin(), cs);
+        q.push_back(cs);
     }
 
     return q;