From b96b3aeb4ac1fae68e77bb38a1553855b8ef16f7 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 17 Jul 2015 10:54:52 +0200 Subject: First cut at libhal support for hash cores with ability to save and restore internal state. Compiles, not yet tested. --- hal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hal.h') diff --git a/hal.h b/hal.h index 8b731d4..15ab8f9 100644 --- a/hal.h +++ b/hal.h @@ -517,6 +517,7 @@ typedef struct { const uint8_t * const digest_algorithm_id; size_t digest_algorithm_id_length; const void *driver; + unsigned can_restore_state : 1; } hal_hash_descriptor_t; /* -- cgit v1.2.3 From 809f0c7e9a4c49aa52b77ec2ab58a970a3ade389 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sat, 18 Jul 2015 10:58:45 +0200 Subject: Add support for dynamic allocation of hash and HMAC state, for cases where it's unavoidable. --- hal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hal.h') diff --git a/hal.h b/hal.h index 15ab8f9..7aeed42 100644 --- a/hal.h +++ b/hal.h @@ -567,6 +567,9 @@ extern hal_error_t hal_hmac_update(const hal_hmac_state_t state, extern hal_error_t hal_hmac_finalize(const hal_hmac_state_t state, uint8_t *hmac, const size_t length); +extern void hal_hash_cleanup(hal_hash_state_t *state); + +extern void hal_hmac_cleanup(hal_hmac_state_t *state); /* * AES key wrap functions. -- cgit v1.2.3