summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs_image.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r--util/cbfstool/cbfs_image.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index baceb51373..f602976177 100644
--- a/util/cbfstool/cbfs_image.h
+++ b/util/cbfstool/cbfs_image.h
@@ -36,6 +36,10 @@ struct cbfs_image {
* enum comp_algo if it's supported, or a number < 0 otherwise. */
int cbfs_parse_comp_algo(const char *name);
+/* Given the string name of a hash algorithm, return the corresponding
+ * id if it's supported, or a number < 0 otherwise. */
+int cbfs_parse_hash_algo(const char *name);
+
/* Given a pointer, serialize the header from host-native byte format
* to cbfs format, i.e. big-endian. */
void cbfs_put_header(void *dest, const struct cbfs_header *header);
@@ -184,4 +188,10 @@ struct cbfs_file_attribute *cbfs_file_next_attr(struct cbfs_file *file,
struct cbfs_file_attribute *cbfs_add_file_attr(struct cbfs_file *header,
uint32_t tag,
uint32_t size);
+
+/* Adds an extended attribute to header, containing a hash of buffer's data of
+ * the type specified by hash_type.
+ * Returns 0 on success, -1 on error. */
+int cbfs_add_file_hash(struct cbfs_file *header, struct buffer *buffer,
+ enum vb2_hash_algorithm hash_type);
#endif