summaryrefslogtreecommitdiff
path: root/ppc/sha1.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-04-23 06:08:43 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-23 06:08:43 (GMT)
commita6ef3518f9ac8a1c46a36c8d27173b1f73d839c4 (patch)
treee6d3a81c30ad237102e2ca82f3dfc57d0b9f0ddf /ppc/sha1.h
parentb5af9107270171b79d46b099ee0b198e653f3a24 (diff)
downloadgit-a6ef3518f9ac8a1c46a36c8d27173b1f73d839c4.zip
git-a6ef3518f9ac8a1c46a36c8d27173b1f73d839c4.tar.gz
git-a6ef3518f9ac8a1c46a36c8d27173b1f73d839c4.tar.bz2
[PATCH] PPC assembly implementation of SHA1
Here is a SHA1 implementation with the core written in PPC assembly. On my 2GHz G5, it does 218MB/s, compared to 135MB/s for the openssl version or 45MB/s for the mozilla version. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'ppc/sha1.h')
-rw-r--r--ppc/sha1.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/ppc/sha1.h b/ppc/sha1.h
new file mode 100644
index 0000000..c3c51aa
--- /dev/null
+++ b/ppc/sha1.h
@@ -0,0 +1,20 @@
+/*
+ * SHA-1 implementation.
+ *
+ * Copyright (C) 2005 Paul Mackerras <paulus@samba.org>
+ */
+#include <stdint.h>
+
+typedef struct sha_context {
+ uint32_t hash[5];
+ uint32_t cnt;
+ uint64_t len;
+ union {
+ unsigned char b[64];
+ uint64_t l[8];
+ } buf;
+} SHA_CTX;
+
+int SHA1_Init(SHA_CTX *c);
+int SHA1_Update(SHA_CTX *c, const void *p, unsigned long n);
+int SHA1_Final(unsigned char *hash, SHA_CTX *c);