ABY Framework  1.0
Arithmetic Bool Yao Framework
 All Classes Files Functions Variables Enumerations Enumerator Macros
simple_hashing.h
1 /*
2  * simle_hashing.h
3  *
4  * Created on: Oct 8, 2014
5  * Author: mzohner
6  */
7 
8 #ifndef SIMLE_HASHING_H_
9 #define SIMLE_HASHING_H_
10 
11 #include "hashing_util.h"
12 
13 struct bin_ctx {
14  //hash-values of all elements mapped to this bin
15  uint8_t* values;
16  //number of elements stored in this bin
17  uint32_t nvals;
18 };
19 
20 typedef struct simple_hash_table_ctx {
21  //pointer to the bins in the hash table
22  bin_ctx* bins;
23  //number bins in the hash table
24  uint32_t nbins;
25  //max bin size
26  uint32_t maxbinsize;
27  //uint32_t addrbitlen;
28  //uint32_t addrbytelen;
29  //uint32_t inbytelen;
30  //uint32_t outbytelen;
31 } sht_ctx;
32 
33 typedef struct simple_hash_entry_gen_ctx {
34  sht_ctx* table;
35  //input elements
36  uint8_t* elements;
37  uint32_t startpos;
38  uint32_t endpos;
39  //uint32_t inbytelen;
40  hs_t* hs;
41 } sheg_ctx;
42 
43 
44 
45 //returns a cuckoo hash table with the first dimension being the bins and the second dimension being the pointer to the elements
46 uint8_t* simple_hashing(uint8_t* elements, uint32_t neles, uint32_t bitlen, uint32_t* outbitlen, uint32_t* nelesinbin, uint32_t nbins,
47  uint32_t* maxbinsize, uint32_t ntasks, uint32_t nhashfuns, prf_state_ctx* prf_state);
48 //routine for generating the entries, is invoked by the threads
49 void *gen_entries(void *ctx);
50 void init_hash_table(sht_ctx* table, uint32_t nelements, hs_t* hs);
51 void increase_max_bin_size(sht_ctx* table, uint32_t valbytelen);
52 void free_hash_table(sht_ctx* table);
53 inline void insert_element(sht_ctx* table, uint8_t* element, uint32_t* address, uint8_t* tmpbuf, hs_t* hs);
54 inline uint32_t get_max_bin_size(uint32_t nbins, uint32_t neles);
55 
56 
57 #endif /* SIMLE_HASHING_H_ */
Definition: simple_hashing.h:33
Definition: simple_hashing.h:13
Definition: hashing_util.h:23
Definition: crypto.h:52
Definition: simple_hashing.h:20