avadapal 1 рік тому
батько
коміт
31ca308010
2 змінених файлів з 12 додано та 21 видалено
  1. 10 12
      duoram-online/duoram.cpp
  2. 2 9
      duoram-online/p2.cpp

+ 10 - 12
duoram-online/duoram.cpp

@@ -189,10 +189,7 @@ int main(const int argc, const char * argv[])
  	//read_final_cws(sockets_2[0]);
  
 
-	block<__m128i> seed;
-	#ifdef ThreeParty	
-    	read(sockets_2[0], boost::asio::buffer(&seed, sizeof(seed)));
-	#endif
+ 
     blinds =	(DB_t *) std::aligned_alloc(sizeof(__m256i), db_nitems * sizeof(DB_t));	
     updated_blinds =	(DB_t *) std::aligned_alloc(sizeof(__m256i), db_nitems * sizeof(DB_t));
 
@@ -243,7 +240,7 @@ int main(const int argc, const char * argv[])
 			DB_t * read_out = new DB_t[number_of_writes];
 			DB_t * Gamma =  new DB_t[number_of_writes];
 		#endif
-		
+
 		DB_t * CW = new DB_t[number_of_writes];  
 	 	
 		DB_t * update_message = new DB_t[number_of_writes];
@@ -285,20 +282,20 @@ int main(const int argc, const char * argv[])
 												dot_product_with_bool(updated_blinds, writing_c, db_nitems, rotate_by_[w])	- 
 												dot_product_with_bool(updated_blinds, writing_d, db_nitems, rotate_by_[w]) + Gamma[w];
 							
-				//#ifdef DEBUG
+				#ifdef DEBUG
 					std::cout << "read_out[" << w << "] = " << read_out[w] << std::endl;
-				//#endif
+				#endif
 
-				//#ifdef DEBUG
+				#ifdef DEBUG
 				std::cout << "reconstructing the output: " << print_reconstruction(sockets_[0], read_out[w]) << "\n";	
-				//#endif
+				#endif
 			
 				distinguised_value[0] = 80 * (1 + w);
 				update_message[w] = distinguised_value[0] - read_out[w]   + alpha0;
 
-				#ifdef DEBUG
-					std::cout << "-> The updated message shares is " << update_message[w] << std::endl;
-				#endif 
+					#ifdef DEBUG
+						std::cout << "-> The updated message shares is " << update_message[w] << std::endl;
+					#endif 
 				boost::asio::write(sockets_2[2], boost::asio::buffer(&update_message[w],  sizeof(DB_t)));
 				boost::asio::write(sockets_[2], boost::asio::buffer(&update_message[w], sizeof(DB_t)));
 				boost::asio::read(sockets_[2], boost::asio::buffer(&CW[w], sizeof(DB_t)));
@@ -310,6 +307,7 @@ int main(const int argc, const char * argv[])
 				#endif 
 			}
 		#endif
+
 		for(size_t w = 0; w < number_of_writes; ++w)
  		{		 
 		  	DuoramUpdate(party,  db_nitems,  rotate_by_[w],  DB, updated_DB, writing_b, b,  CW[w],  update_message[w],  writing_c, writing_d, c, d);

+ 2 - 9
duoram-online/p2.cpp

@@ -250,20 +250,13 @@ int main(int argc, char* argv[])
      return 1;
      }
 
-  //quick_fix_send_ones_share(sockets_0[0], sockets_1[0]);
-
-  block<__m128i> seed0, seed1;
-
-  arc4random_buf(&seed0, sizeof(block<__m128i>));
-  arc4random_buf(&seed1, sizeof(block<__m128i>));
+ 
   
   X0 = (DB_t *) std::aligned_alloc(sizeof(__m256i), db_nitems * sizeof(DB_t));
   X1 = (DB_t *) std::aligned_alloc(sizeof(__m256i), db_nitems * sizeof(DB_t));
     
  
-
-  boost::asio::write(sockets_0[0], boost::asio::buffer(&seed0, sizeof(seed0))); 
-  boost::asio::write(sockets_1[0], boost::asio::buffer(&seed1, sizeof(seed1)));
+ 
  
   for(size_t j = 0; j < db_nitems; ++j)
   {