summaryrefslogtreecommitdiff
path: root/host/lib21/include/host_signature2.h
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib21/include/host_signature2.h')
-rw-r--r--host/lib21/include/host_signature2.h39
1 files changed, 17 insertions, 22 deletions
diff --git a/host/lib21/include/host_signature2.h b/host/lib21/include/host_signature2.h
index 5faf6da7..0b1784af 100644
--- a/host/lib21/include/host_signature2.h
+++ b/host/lib21/include/host_signature2.h
@@ -21,9 +21,8 @@ struct vb21_signature;
* @param size_ptr On success, contains the info size in bytes
* @return VB2_SUCCESS, or non-zero error code on failure.
*/
-int vb2_digest_info(enum vb2_hash_algorithm hash_alg,
- const uint8_t **buf_ptr,
- uint32_t *size_ptr);
+vb2_error_t vb2_digest_info(enum vb2_hash_algorithm hash_alg,
+ const uint8_t **buf_ptr, uint32_t *size_ptr);
/**
* Sign data buffer
@@ -37,11 +36,9 @@ int vb2_digest_info(enum vb2_hash_algorithm hash_alg,
* key description will be used.
* @return VB2_SUCCESS, or non-zero error code on failure.
*/
-int vb21_sign_data(struct vb21_signature **sig_ptr,
- const uint8_t *data,
- uint32_t size,
- const struct vb2_private_key *key,
- const char *desc);
+vb2_error_t vb21_sign_data(struct vb21_signature **sig_ptr, const uint8_t *data,
+ uint32_t size, const struct vb2_private_key *key,
+ const char *desc);
/**
* Calculate the signature size for a private key.
@@ -52,9 +49,9 @@ int vb21_sign_data(struct vb21_signature **sig_ptr,
* key description will be used.
* @return VB2_SUCCESS, or non-zero error code on failure.
*/
-int vb21_sig_size_for_key(uint32_t *size_ptr,
- const struct vb2_private_key *key,
- const char *desc);
+vb2_error_t vb21_sig_size_for_key(uint32_t *size_ptr,
+ const struct vb2_private_key *key,
+ const char *desc);
/**
* Calculate the total signature size for a list of keys.
@@ -64,9 +61,9 @@ int vb21_sig_size_for_key(uint32_t *size_ptr,
* @param key_count Number of keys.
* @return VB2_SUCCESS, or non-zero error code on failure.
*/
-int vb21_sig_size_for_keys(uint32_t *size_ptr,
- const struct vb2_private_key **key_list,
- uint32_t key_count);
+vb2_error_t vb21_sig_size_for_keys(uint32_t *size_ptr,
+ const struct vb2_private_key **key_list,
+ uint32_t key_count);
/**
* Sign object with a key.
@@ -78,10 +75,9 @@ int vb21_sig_size_for_keys(uint32_t *size_ptr,
* @param key Key to sign object with
* @param desc If non-null, description to use for signature
*/
-int vb21_sign_object(uint8_t *buf,
- uint32_t sig_offset,
- const struct vb2_private_key *key,
- const char *desc);
+vb2_error_t vb21_sign_object(uint8_t *buf, uint32_t sig_offset,
+ const struct vb2_private_key *key,
+ const char *desc);
/**
* Sign object with list of keys.
@@ -93,9 +89,8 @@ int vb21_sign_object(uint8_t *buf,
* @param key_list List of keys to sign object with
* @param key_count Number of keys in list
*/
-int vb21_sign_object_multiple(uint8_t *buf,
- uint32_t sig_offset,
- const struct vb2_private_key **key_list,
- uint32_t key_count);
+vb2_error_t vb21_sign_object_multiple(uint8_t *buf, uint32_t sig_offset,
+ const struct vb2_private_key **key_list,
+ uint32_t key_count);
#endif /* VBOOT_REFERENCE_HOST_SIGNATURE2_H_ */