#ifndef MAC_STORE_H
#define MAC_STORE_H
#include "cmac_context.h"
#include "hmac_context.h"
#include "object_store.h"
#include "sa_types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct mac_s mac_t;
sa_mac_algorithm mac_get_algorithm(const mac_t* mac);
hmac_context_t* mac_get_hmac_context(const mac_t* mac);
cmac_context_t* mac_get_cmac_context(const mac_t* mac);
typedef object_store_t mac_store_t;
mac_store_t* mac_store_init(size_t size);
void mac_store_shutdown(mac_store_t* store);
sa_status mac_store_add_hmac_context(
sa_crypto_mac_context* context,
mac_store_t* store,
hmac_context_t* hmac_context,
const sa_uuid* caller_uuid);
sa_status mac_store_add_cmac_context(
sa_crypto_mac_context* context,
mac_store_t* store,
cmac_context_t* cmac_context,
const sa_uuid* caller_uuid);
sa_status mac_store_remove(
mac_store_t* store,
sa_crypto_mac_context context,
const sa_uuid* caller_uuid);
sa_status mac_store_acquire_exclusive(
mac_t** mac,
mac_store_t* store,
size_t slot,
const sa_uuid* caller_uuid);
sa_status mac_store_release_exclusive(
mac_store_t* store,
sa_crypto_mac_context context,
mac_t* mac,
const sa_uuid* caller_uuid);
#ifdef __cplusplus
}
#endif
#endif