aboutsummaryrefslogtreecommitdiff
path: root/hal.h
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-12-13 00:43:11 -0500
committerRob Austein <sra@hactrn.net>2015-12-13 00:43:11 -0500
commitc60b4bbd62865c4fe891dcbf7586c4718082d626 (patch)
treec7a4e2ba247241df3b3fecd79cee197c84646881 /hal.h
parent6f479d8615a60e94b3c19e090a4eba8a0256ec32 (diff)
Add rpc_hash.c. Convert dynamic allocator in hash.c to use private
pool of pre-configured state blocks, suitable for an embedded system.
Diffstat (limited to 'hal.h')
-rw-r--r--hal.h14
1 files changed, 14 insertions, 0 deletions
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.
*/