From c60b4bbd62865c4fe891dcbf7586c4718082d626 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 13 Dec 2015 00:43:11 -0500 Subject: Add rpc_hash.c. Convert dynamic allocator in hash.c to use private pool of pre-configured state blocks, suitable for an embedded system. --- hal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hal.h') diff --git a/hal.h b/hal.h index eb1e253..1ccc491 100644 --- a/hal.h +++ b/hal.h @@ -221,7 +221,17 @@ typedef struct hal_hash_driver hal_hash_driver_t; * problem. */ +typedef enum { + hal_digest_algorithm_sha1, + hal_digest_algorithm_sha256, + hal_digest_algorithm_sha512_224, + hal_digest_algorithm_sha512_256, + hal_digest_algorithm_sha384, + hal_digest_algorithm_sha512 +} hal_digest_algorithm_t; + typedef struct { + hal_digest_algorithm_t digest_algorithm; size_t block_length; size_t digest_length; size_t hash_state_length; @@ -284,6 +294,10 @@ extern void hal_hash_cleanup(hal_hash_state_t **state); extern void hal_hmac_cleanup(hal_hmac_state_t **state); +extern const hal_hash_descriptor_t *hal_hash_get_descriptor(const hal_hash_state_t * const state); + +extern const hal_hash_descriptor_t *hal_hmac_get_descriptor(const hal_hmac_state_t * const state); + /* * AES key wrap functions. */ -- cgit v1.2.3