aboutsummaryrefslogtreecommitdiff
path: root/hal.h
diff options
context:
space:
mode:
Diffstat (limited to 'hal.h')
-rw-r--r--hal.h44
1 files changed, 24 insertions, 20 deletions
diff --git a/hal.h b/hal.h
index 7adfd39..84d9c0c 100644
--- a/hal.h
+++ b/hal.h
@@ -704,6 +704,30 @@ extern hal_error_t hal_ecdsa_verify(hal_core_t *core,
const uint8_t * const signature, const size_t signature_len);
/*
+ * Enums for hash-based signatures, to avoid forward reference problem.
+ * Rest of hash-based signature declarations should be here too, but
+ * at the moment we're trying for minimal change needed to deal with
+ * a new pedantic warning.
+ */
+
+typedef enum hal_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 hal_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;
+
+/*
* UUID stuff. All UUIDs we use (or are likely to use) are type 4 "random" UUIDs
*/
@@ -899,9 +923,6 @@ 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 hal_lmots_algorithm_type hal_lmots_algorithm_t;
-typedef enum hal_lms_algorithm_type 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,
@@ -995,23 +1016,6 @@ extern hal_error_t hal_rpc_server_dispatch(const uint8_t * const ibuf, const siz
* references to hal_key_flags_t and hal_uuid_t.
*/
-enum hal_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
-};
-
-enum hal_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
-};
-
typedef struct hal_hashsig_key hal_hashsig_key_t;
extern const size_t hal_hashsig_key_t_size;