From 7537c3a6f3c50301f220a0f1500afda904b4a2cf Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Sun, 12 Aug 2018 15:01:06 -0400 Subject: Clean up builds for *BSD/clang. Move lm[ot]s_algorithm_t definitions to hal.h, prefix all public symbols with 'hal_'. Remove some unused functions. Wrap hal_pkey_slot_t initializers in an extra set of curly braces. Remove an unused-argument kludge (x=x;) because gcc doesn't care, and clang complains. Make timersub a proper macro. Add some casts to printf arguments, because !@#$ printf formats. --- hal.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'hal.h') diff --git a/hal.h b/hal.h index b544900..2b1b50c 100644 --- a/hal.h +++ b/hal.h @@ -815,16 +815,30 @@ extern hal_error_t hal_rpc_pkey_generate_ec(const hal_client_handle_t client, const hal_curve_name_t curve, const hal_key_flags_t flags); -typedef enum lmots_algorithm_type lmots_algorithm_t; -typedef enum lms_algorithm_type lms_algorithm_t; +typedef enum lmots_algorithm_type { + hal_lmots_reserved = 0, + hal_lmots_sha256_n32_w1 = 1, + hal_lmots_sha256_n32_w2 = 2, + hal_lmots_sha256_n32_w4 = 3, + hal_lmots_sha256_n32_w8 = 4 +} hal_lmots_algorithm_t; + +typedef enum lms_algorithm_type { + hal_lms_reserved = 0, + hal_lms_sha256_n32_h5 = 5, + hal_lms_sha256_n32_h10 = 6, + hal_lms_sha256_n32_h15 = 7, + hal_lms_sha256_n32_h20 = 8, + hal_lms_sha256_n32_h25 = 9 +} hal_lms_algorithm_t; extern hal_error_t hal_rpc_pkey_generate_hashsig(const hal_client_handle_t client, const hal_session_handle_t session, hal_pkey_handle_t *pkey, hal_uuid_t *name, const size_t hss_levels, - const lms_algorithm_t lms_type, - const lmots_algorithm_t lmots_type, + const hal_lms_algorithm_t lms_type, + const hal_lmots_algorithm_t lmots_type, const hal_key_flags_t flags); extern hal_error_t hal_rpc_pkey_close(const hal_pkey_handle_t pkey); -- cgit v1.2.3