Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2005-09-20 20:27:13 +0400
committerJunio C Hamano <junkio@cox.net>2005-09-21 05:10:00 +0400
commit7c6ef2f2142f0a4c22b5505d95553cac17867a21 (patch)
tree5eff144d174355bd17dc7b12d77af58202c46ea5 /arm/sha1.h
parentf1f0d0889e5557bc467490fdbd53f7b912503a33 (diff)
[PATCH] ARM optimized SHA1 implementation
This is my ARM assembly SHA1 implementation for GIT. It is approximately 50% faster than the generic C version. On an XScale processor running at 400MHz: generic C version: 9.8 MB/s my version: 14.5 MB/s It's not that I expect a lot of big GIT users on ARM, but I stillknow about one important ARM user that might benefit from it, and writing that code was fun. I also reworked the makefile a bit so any optimized SHA1 implementations is used regardless of whether NO_OPENSSL is defined or not. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'arm/sha1.h')
-rw-r--r--arm/sha1.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arm/sha1.h b/arm/sha1.h
new file mode 100644
index 0000000000..3952646349
--- /dev/null
+++ b/arm/sha1.h
@@ -0,0 +1,18 @@
+/*
+ * SHA-1 implementation optimized for ARM
+ *
+ * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
+ * Created: September 17, 2005
+ */
+
+#include <stdint.h>
+
+typedef struct sha_context {
+ uint64_t len;
+ uint32_t hash[5];
+ unsigned char buffer[64];
+} SHA_CTX;
+
+void SHA1_Init(SHA_CTX *c);
+void SHA1_Update(SHA_CTX *c, const void *p, unsigned long n);
+void SHA1_Final(unsigned char *hash, SHA_CTX *c);