path: root/utils/nwztools/upgtools/mg.h
diff options
authorAmaury Pouly <>2020-08-10 23:09:46 +0200
committerAmaury Pouly <>2020-10-11 13:08:03 +0200
commit8ce60c54f762b2f1392bee586dc8292170c87696 (patch)
treed979e6ebe4a54b07c57a9995cf2973118504e799 /utils/nwztools/upgtools/mg.h
parent7cba59910669062b320eb57d831f3a9c50efb364 (diff)
nwztools/upgtool: add support for MD5
When compressing, it is possible to tell the tool to add an entry to the MD5 file (index 1), it is still necessary to give an empty file for that index. To do so, pass the option "-z idx,name" insteas of "-z idx". This will create an entry of the form "size md5 name". For instance "-z 6,system.img". When decompressing, if one passes "-z idx,name" instead of "-z idx", the tool will decompress and check against the value in the MD5 file. Change-Id: Ifb945f6121644ae9105265d2d83ce6067301c5b2
Diffstat (limited to 'utils/nwztools/upgtools/mg.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/nwztools/upgtools/mg.h b/utils/nwztools/upgtools/mg.h
index 3f7de2cd9b..a2de5952fd 100644
--- a/utils/nwztools/upgtools/mg.h
+++ b/utils/nwztools/upgtools/mg.h
@@ -30,6 +30,10 @@ extern "C" {
/* Compute the MD5 digest of a buffer */
void MD5_CalculateDigest(void *digest, const void *input, size_t length);
+/* Compute MD5 in more than one step */
+void *md5_start(); /* return an opaque pointer */
+void md5_update(void *md5_obj, const void *input, size_t length);
+void md5_final(void *md5_obj, void *digest); /* destroys the MD5 object */
/* size must be a multiple of 8, this function is thread-safe */
void mg_decrypt_fw(void *in, int size, void *out, uint8_t key[8]);