8 status_e hash_init(
struct heivs_hash_t *hash,
void *state,
size_t state_size)
12 if (hash->state != HASH_STATE_IDLE)
17 if (state_size < hash->state_size)
27 status = hash->init(hash, state, state_size);
33 hash->state = HASH_STATE_BUSY;
38 status_e hash_run(
struct heivs_hash_t *hash,
void *state,
const void *data,
size_t size)
42 if (hash->state != HASH_STATE_BUSY)
47 status = hash->run(hash, state, data, size);
50 hash->state = HASH_STATE_IDLE;
57 status_e hash_finish(
struct heivs_hash_t *hash,
void *state)
61 if (hash->state != HASH_STATE_BUSY)
66 status = hash->finish(hash, state);
69 hash->state = HASH_STATE_IDLE;
73 hash->state = HASH_STATE_IDLE;
Function called at bad time.