Browse Source

Tweaks for ORAM Integration

sshsshy 5 years ago
parent
commit
4c84f5a96f
1 changed files with 12 additions and 10 deletions
  1. 12 10
      ZT_ORAMserver.cc

+ 12 - 10
ZT_ORAMserver.cc

@@ -349,6 +349,8 @@ int ZT_ORAMServer::LSORAM_Insert(unsigned char *key, uint32_t key_size, unsigned
 }
 
 void ZT_ORAMServer::store(const string &key, const string &value){
+
+  fprintf(stderr, "ZT_ORAMServer: Started store\n");
   if (value.length() > 0) {
     //Create encrypted request with strings key, value
    
@@ -359,13 +361,13 @@ void ZT_ORAMServer::store(const string &key, const string &value){
     LSORAM_Insert((unsigned char*) key.c_str(), BLINDED_KEY_SIZE,
           (unsigned char*) value.c_str(), DESCRIPTOR_MAX_SIZE);
 
-    fprintf(stderr, "ZT_LSORAMServer: STORED HSDesc Key = ");
+    fprintf(stderr, "ZT_ORAMServer: STORED HSDesc Key = ");
     for(uint32_t i = 0; i <32; i++){
       fprintf(stderr, "%02x", key_ptr[i]);
     }    
     fprintf(stderr,"\n");
 
-    fprintf(stderr, "ZT_LSORAMServer: STORED (First 32 bytes of ) HSDesc Value= ");
+    fprintf(stderr, "ZT_ORAMServer: STORED (First 32 bytes of ) HSDesc Value= ");
     for(uint64_t i = 0; i < 32; i++){
       fprintf(stderr, "%02x", value_ptr[i]);
     }    
@@ -388,9 +390,9 @@ void ZT_ORAMServer::store(const string &key, const string &value){
 
 bool ZT_ORAMServer::lookup(const string &lookup_query, string &lookup_response) {
 
-  fprintf(stderr, "ZT_LSORAMServer: Starting lookup() call\n");
+  fprintf(stderr, "ZT_ORAMServer: Starting lookup() call\n");
   const char *lookup_query_cstr= lookup_query.c_str();
-  fprintf(stderr, "ZT_LSORAMServer: lookup_query length = %ld\n", lookup_query.length());
+  fprintf(stderr, "ZT_ORAMServer: lookup_query length = %ld\n", lookup_query.length());
   unsigned char *encrypted_query = (unsigned char*) malloc (BLINDED_KEY_SIZE);
   unsigned char *tag_in = (unsigned char*) malloc (TAG_SIZE);
   uint32_t pk_x_size;
@@ -398,7 +400,7 @@ bool ZT_ORAMServer::lookup(const string &lookup_query, string &lookup_response)
   unsigned char *client_pubkey;
   
 
-  fprintf(stderr, "ZT_LSORAMServer: Before parsing lookup_query_cstr\n");
+  fprintf(stderr, "ZT_ORAMServer: Before parsing lookup_query_cstr\n");
   unsigned char *ptr = (unsigned char*) lookup_query_cstr;
   memcpy(encrypted_query, ptr, BLINDED_KEY_SIZE);
   ptr+=BLINDED_KEY_SIZE;
@@ -412,8 +414,8 @@ bool ZT_ORAMServer::lookup(const string &lookup_query, string &lookup_response)
   size_t expected_size = BLINDED_KEY_SIZE+TAG_SIZE+ 2*sizeof(uint32_t) + 
            pk_x_size + pk_y_size;
   
-  fprintf(stderr, "ZT_LSORAMServer: Before allocating client_pubkey call (%d,%d)\n", pk_x_size, pk_y_size);
-  fprintf(stderr, "ZT_LSORAMServer: expected_size = %ld, lookup_query.length = %ld\n", expected_size, lookup_query.length());
+  fprintf(stderr, "ZT_ORAMServer: Before allocating client_pubkey call (%d,%d)\n", pk_x_size, pk_y_size);
+  fprintf(stderr, "ZT_ORAMServer: expected_size = %ld, lookup_query.length = %ld\n", expected_size, lookup_query.length());
 
   /*
   if(lookup_query.length()!=expected_size)
@@ -428,11 +430,11 @@ bool ZT_ORAMServer::lookup(const string &lookup_query, string &lookup_response)
   unsigned char *encrypted_response = (unsigned char*) malloc(DESCRIPTOR_MAX_SIZE);
   unsigned char *tag_out = (unsigned char*) malloc(TAG_SIZE);
 
-  fprintf(stderr, "ZT_LSORAMServer: Before ZT_LSORAM_fetch() call\n");
+  fprintf(stderr, "ZT_ORAMServer: Before ZT_LSORAM_fetch() call\n");
   ZT_HSORAM_fetch(ZT_lsoram_iid, ZT_oram_iid, ORAM_TYPE, encrypted_query, BLINDED_KEY_SIZE,
      encrypted_response, DESCRIPTOR_MAX_SIZE, tag_in, tag_out, TAG_SIZE,
      client_pubkey, pk_x_size, pk_y_size);
-  fprintf(stderr, "ZT_LSORAMServer: After ZT_LSORAM_fetch() call\n");
+  fprintf(stderr, "ZT_ORAMServer: After ZT_LSORAM_fetch() call\n");
 
   lookup_response.assign((const char*) encrypted_response, DESCRIPTOR_MAX_SIZE);
   lookup_response.append((const char*) tag_out, TAG_SIZE);
@@ -443,7 +445,7 @@ bool ZT_ORAMServer::lookup(const string &lookup_query, string &lookup_response)
   free(encrypted_query);
   free(tag_in);
 
-  fprintf(stderr, "ZT_LSORAMServer: Finished lookup() call\n");
+  fprintf(stderr, "ZT_ORAMServer: Finished lookup() call\n");
   return 1;
 }