53#define HASH_KEY_LEN 16
77 const void *
key, uint64_t hv);
106static inline uint64_t
112static inline uint32_t
118static inline uint32_t
Buffer management functions and garbage collection.
#define ALLOC_OBJ(dptr, type)
Allocate memory for a single object of the given type.
static bool hash_remove(struct hash *hash, const void *key)
void hash_iterator_init(struct hash *hash, struct hash_iterator *iter)
void hash_iterator_free(struct hash_iterator *hi)
struct hash_element * hash_iterator_next(struct hash_iterator *hi)
static void * hash_lookup(struct hash *hash, const void *key)
void hash_iterator_delete_element(struct hash_iterator *hi)
static uint32_t hash_n_elements(const struct hash *hash)
static uint32_t hash_n_buckets(const struct hash *hash)
struct hash * hash_init(const uint32_t n_buckets, uint64_t(*hash_function)(const void *key, const uint8_t hash_key[HASH_KEY_LEN]), bool(*compare_function)(const void *key1, const void *key2))
static void hash_add_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint64_t hv, void *value)
bool hash_remove_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint64_t hv)
void hash_free(struct hash *hash)
struct hash_element * hash_lookup_fast(struct hash *hash, struct hash_bucket *bucket, const void *key, uint64_t hv)
bool hash_add(struct hash *hash, const void *key, void *value, bool replace)
void hash_remove_by_value(struct hash *hash, void *value)
void hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, uint32_t start_bucket, uint32_t end_bucket)
static uint64_t hash_value(const struct hash *hash, const void *key)
struct hash_element * list
struct hash_element * next
uint32_t bucket_index_end
struct hash_bucket * bucket
struct hash_element * elem
uint32_t bucket_index_start
struct hash_element * last
struct hash_bucket * buckets
uint64_t(* hash_function)(const void *key, const uint8_t hash_key[HASH_KEY_LEN])
uint8_t hash_key[HASH_KEY_LEN]
key/iv used for the hash function.
bool(* compare_function)(const void *key1, const void *key2)
Container for bidirectional cipher and HMAC key material.
Container for unidirectional cipher and HMAC key material.