Go to the documentation of this file.
40 #define hashsize(n) ((uint32_t)1<<(n))
41 #define hashmask(n) (hashsize(n)-1)
113 uint32_t
hash_func(
const uint8_t *k, uint32_t length, uint32_t initval);
115 static inline uint32_t
static int hash_n_elements(const struct hash *hash)
static struct hash_bucket * hash_bucket(struct hash *hash, uint32_t hv)
void hash_remove_by_value(struct hash *hash, void *value)
struct hash_element * next
static const char *const key1
static bool hash_remove(struct hash *hash, const void *key)
static void * hash_lookup(struct hash *hash, const void *key)
struct hash_bucket * buckets
Container for unidirectional cipher and HMAC key material.
uint32_t(* hash_function)(const void *key, uint32_t iv)
static void hash_add_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint32_t hv, void *value)
#define ALLOC_OBJ(dptr, type)
bool hash_add(struct hash *hash, const void *key, void *value, bool replace)
struct hash_element * list
void hash_free(struct hash *hash)
struct hash_element * elem
bool hash_remove_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint32_t hv)
uint32_t hash_func(const uint8_t *k, uint32_t length, uint32_t initval)
void hash_iterator_free(struct hash_iterator *hi)
void hash_iterator_init(struct hash *hash, struct hash_iterator *iter)
struct hash * hash_init(const int n_buckets, const uint32_t iv, uint32_t(*hash_function)(const void *key, uint32_t iv), bool(*compare_function)(const void *key1, const void *key2))
struct hash_element * hash_lookup_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint32_t hv)
struct hash_bucket * bucket
void hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, int start_bucket, int end_bucket)
Container for bidirectional cipher and HMAC key material.
static int hash_n_buckets(const struct hash *hash)
bool(* compare_function)(const void *key1, const void *key2)
struct hash_element * last
struct hash_element * hash_iterator_next(struct hash_iterator *hi)
static uint32_t hash_value(const struct hash *hash, const void *key)
void hash_iterator_delete_element(struct hash_iterator *hi)