1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-30 13:57:54 +01:00
git/ppc/sha1.h
Paul Mackerras a6ef3518f9 [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>
2005-04-22 23:08:43 -07:00

20 lines
396 B
C

/*
* 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);