Queries on Encrypted Data Library

Populating the HVE:

Preliminaries

  • Populate the HVE sector one at a time.
  • Use data to populate the HVE according to the specified format.
  • Each sector is expecting a certain type of query, this type must be matched when populating the HVE.


    For GenToken: You do not have to populate all sectors of your HVE_t, only the ones that you would like to query. For example, there may be one sector in your HVE_t with a query that you do not care to check. By leaving the sector unpopulated, it acts as a wild card, and any value in the HVE_t sector in encrypt is acceptable.


    Populate a Comparison Query Sector: declare a variable of type HVE_COMPARISON_t as follows:
    HVE_COMPARISON_t comp = { size_t value, int sector};
    
    int HVE_Insert_Comparison(HVE_t *HVE, HVE_COMPARISON_t *comp);


    Populate an Equality Query sector: declare a variable of type HVE_EQUALITY_t as follows:
    HVE_EQUALITY_t eq = {char *text, int text_len , int sector};
    
    int HVE_Insert_Equality(HVE_t *HVE, HVE_EQUALITY *eq);


    Populate a Subset Query sector: follow the below steps:
    1. Specify the values to be used in the query by declaring an array of type HVE_SUBSET_DATA_t. Each HVE_SUBSET_DATA_t entry consists of a character string and its length. The array must be terminated with an HVE_SUBSET_DATA_t equal to {END, END}. This last entry must be taken into the length of the array.
      HVE_SUBSET_DATA_t data[num_elem_in_subset]= {
              {"str1", str1_len}, 
      	{"str2", str2_len}, 
      	..        ...,
      	{END, END}  
      };
    2. Second specify which sector in the HVE this data is populating by declaring a variable of type HVE_SUBSET_t and using the above HVE_SUBSET_DATA_t to initialize it as follows:
      HVE_SUBSET_t sub = { data, num_elem_in_sub, sector};
      int HVE_Insert_Subset(HVE_t *HVE, HVE_SUBSET_t *sub);
      


    Populate a Raw Query sector: declare a variable of type HVE_RAW_t as follows:
    HVE_RAW_t raw = {int value, int sector};
    
    int HVE_Insert_Raw(HVE_t *HVE, HVE_Equality *eq);