summaryrefslogtreecommitdiff
path: root/include/hash.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-06-02 22:04:49 -0600
committerTom Rini <trini@ti.com>2014-06-11 16:25:46 -0400
commit31890ae299bca739c58b311dfced0bb199a5f520 (patch)
treead68127a4b7b0edf821c57f27166f0708e5f0448 /include/hash.h
parent7e4154a553c56ccbf877ac830e15b9c23815eb4d (diff)
hash: Export the function to show a hash
This function is useful for displaying a hash value, so export it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/hash.h')
-rw-r--r--include/hash.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/hash.h b/include/hash.h
index 2a3632623b..5cb4dbfcb2 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -126,5 +126,19 @@ int hash_block(const char *algo_name, const void *data, unsigned int len,
* @return 0 if ok, -EPROTONOSUPPORT for an unknown algorithm.
*/
int hash_lookup_algo(const char *algo_name, struct hash_algo **algop);
+
+/**
+ * hash_show() - Print out a hash algorithm and value
+ *
+ * You will get a message like this (without a newline at the end):
+ *
+ * "sha1 for 9eb3337c ... 9eb3338f ==> 7942ef1df479fd3130f716eb9613d107dab7e257"
+ *
+ * @algo: Algorithm used for hash
+ * @addr: Address of data that was hashed
+ * @len: Length of data that was hashed
+ * @output: Hash value to display
+ */
+void hash_show(struct hash_algo *algo, ulong addr, ulong len, u8 *output);
#endif /* !USE_HOSTCC */
#endif