summaryrefslogtreecommitdiff
path: root/include/xsha1.h
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2009-10-14 23:20:44 +0200
committerJulien Cristau <jcristau@debian.org>2009-10-15 01:17:44 +0200
commit55516094947dd78ad2734bb784a2fb109b64c990 (patch)
treea33fc94df894e66357c09ec05798355a3a67a11c /include/xsha1.h
parent25344ba7f7845654364d62bf15322b3b79465bd9 (diff)
Move SHA1 computation from render/glyph.c to os/
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: RĂ©mi Cardona <remi@gentoo.org>
Diffstat (limited to 'include/xsha1.h')
-rw-r--r--include/xsha1.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/xsha1.h b/include/xsha1.h
new file mode 100644
index 000000000..aab71067a
--- /dev/null
+++ b/include/xsha1.h
@@ -0,0 +1,19 @@
+#ifndef XSHA1_H
+#define XSHA1_H
+
+/* Initialize SHA1 computation. Returns NULL on error. */
+void *x_sha1_init(void);
+
+/*
+ * Add some data to be hashed. ctx is the value returned by x_sha1_init()
+ * Returns 0 on error, 1 on success.
+ */
+int x_sha1_update(void *ctx, void *data, int size);
+
+/*
+ * Place the hash in result, and free ctx.
+ * Returns 0 on error, 1 on success.
+ */
+int x_sha1_final(void *ctx, unsigned char result[20]);
+
+#endif