@matheusbsbs / matheus-bagliano / commits / 30ae47b4cc
Fork 0

remove ARM and Mozilla SHA1 implementations

They are both slower than the new BLK_SHA1 implementation, so it is pointless to keep them around. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nicolas Pitre committed Aug 17, 2009 at 20:09 UTC 30ae47b4cc19dce42f51b4fa378d315a71b08957
9 files changed +11 -526
Makefile
+2 -24
@@ -16,7 +16,7 @@ all::
16 # when attempting to read from an fopen'ed directory.
17 #
18 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
19 -# This also implies MOZILLA_SHA1.
19 +# This also implies BLK_SHA1.
20 #
21 # Define NO_CURL if you do not have libcurl installed. git-http-pull and
22 # git-http-push are not built, and you cannot use http:// and https://
@@ -91,14 +91,6 @@ all::
91 # Define PPC_SHA1 environment variable when running make to make use of
92 # a bundled SHA1 routine optimized for PowerPC.
93 #
94 -# Define ARM_SHA1 environment variable when running make to make use of
95 -# a bundled SHA1 routine optimized for ARM.
96 -#
97 -# Define MOZILLA_SHA1 environment variable when running make to make use of
98 -# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
99 -# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
100 -# choice) has very fast version optimized for i586.
101 -#
94 # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
95 #
96 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
@@ -926,10 +918,6 @@ else
918 NO_PTHREADS = YesPlease
919 endif
920 endif
929 -ifneq (,$(findstring arm,$(uname_M)))
930 - ARM_SHA1 = YesPlease
931 - NO_MKSTEMPS = YesPlease
932 -endif
921
922 -include config.mak.autogen
923 -include config.mak
@@ -1022,7 +1010,7 @@ ifndef NO_OPENSSL
1010 endif
1011 else
1012 BASIC_CFLAGS += -DNO_OPENSSL
1025 - MOZILLA_SHA1 = 1
1013 + BLK_SHA1 = 1
1014 OPENSSL_LIBSSL =
1015 endif
1016 ifdef NEEDS_SSL_WITH_CRYPTO
@@ -1178,21 +1166,11 @@ else
1166 ifdef PPC_SHA1
1167 SHA1_HEADER = "ppc/sha1.h"
1168 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
1181 -else
1182 -ifdef ARM_SHA1
1183 - SHA1_HEADER = "arm/sha1.h"
1184 - LIB_OBJS += arm/sha1.o arm/sha1_arm.o
1185 -else
1186 -ifdef MOZILLA_SHA1
1187 - SHA1_HEADER = "mozilla-sha1/sha1.h"
1188 - LIB_OBJS += mozilla-sha1/sha1.o
1169 else
1170 SHA1_HEADER = <openssl/sha.h>
1171 EXTLIBS += $(LIB_4_CRYPTO)
1172 endif
1173 endif
1194 -endif
1195 -endif
1174 ifdef NO_PERL_MAKEMAKER
1175 export NO_PERL_MAKEMAKER
1176 endif
arm/sha1.c deleted
-82
@@ -1,82 +0,0 @@
1 -/*
2 - * SHA-1 implementation optimized for ARM
3 - *
4 - * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
5 - * Created: September 17, 2005
6 - */
7 -
8 -#include <string.h>
9 -#include "sha1.h"
10 -
11 -extern void arm_sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
12 -
13 -void arm_SHA1_Init(arm_SHA_CTX *c)
14 -{
15 - c->len = 0;
16 - c->hash[0] = 0x67452301;
17 - c->hash[1] = 0xefcdab89;
18 - c->hash[2] = 0x98badcfe;
19 - c->hash[3] = 0x10325476;
20 - c->hash[4] = 0xc3d2e1f0;
21 -}
22 -
23 -void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n)
24 -{
25 - uint32_t workspace[80];
26 - unsigned int partial;
27 - unsigned long done;
28 -
29 - partial = c->len & 0x3f;
30 - c->len += n;
31 - if ((partial + n) >= 64) {
32 - if (partial) {
33 - done = 64 - partial;
34 - memcpy(c->buffer + partial, p, done);
35 - arm_sha_transform(c->hash, c->buffer, workspace);
36 - partial = 0;
37 - } else
38 - done = 0;
39 - while (n >= done + 64) {
40 - arm_sha_transform(c->hash, p + done, workspace);
41 - done += 64;
42 - }
43 - } else
44 - done = 0;
45 - if (n - done)
46 - memcpy(c->buffer + partial, p + done, n - done);
47 -}
48 -
49 -void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c)
50 -{
51 - uint64_t bitlen;
52 - uint32_t bitlen_hi, bitlen_lo;
53 - unsigned int i, offset, padlen;
54 - unsigned char bits[8];
55 - static const unsigned char padding[64] = { 0x80, };
56 -
57 - bitlen = c->len << 3;
58 - offset = c->len & 0x3f;
59 - padlen = ((offset < 56) ? 56 : (64 + 56)) - offset;
60 - arm_SHA1_Update(c, padding, padlen);
61 -
62 - bitlen_hi = bitlen >> 32;
63 - bitlen_lo = bitlen & 0xffffffff;
64 - bits[0] = bitlen_hi >> 24;
65 - bits[1] = bitlen_hi >> 16;
66 - bits[2] = bitlen_hi >> 8;
67 - bits[3] = bitlen_hi;
68 - bits[4] = bitlen_lo >> 24;
69 - bits[5] = bitlen_lo >> 16;
70 - bits[6] = bitlen_lo >> 8;
71 - bits[7] = bitlen_lo;
72 - arm_SHA1_Update(c, bits, 8);
73 -
74 - for (i = 0; i < 5; i++) {
75 - uint32_t v = c->hash[i];
76 - hash[0] = v >> 24;
77 - hash[1] = v >> 16;
78 - hash[2] = v >> 8;
79 - hash[3] = v;
80 - hash += 4;
81 - }
82 -}
arm/sha1.h deleted
-23
@@ -1,23 +0,0 @@
1 -/*
2 - * SHA-1 implementation optimized for ARM
3 - *
4 - * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
5 - * Created: September 17, 2005
6 - */
7 -
8 -#include <stdint.h>
9 -
10 -typedef struct {
11 - uint64_t len;
12 - uint32_t hash[5];
13 - unsigned char buffer[64];
14 -} arm_SHA_CTX;
15 -
16 -void arm_SHA1_Init(arm_SHA_CTX *c);
17 -void arm_SHA1_Update(arm_SHA_CTX *c, const void *p, unsigned long n);
18 -void arm_SHA1_Final(unsigned char *hash, arm_SHA_CTX *c);
19 -
20 -#define git_SHA_CTX arm_SHA_CTX
21 -#define git_SHA1_Init arm_SHA1_Init
22 -#define git_SHA1_Update arm_SHA1_Update
23 -#define git_SHA1_Final arm_SHA1_Final
arm/sha1_arm.S deleted
-183
@@ -1,183 +0,0 @@
1 -/*
2 - * SHA transform optimized for ARM
3 - *
4 - * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org>
5 - * Created: September 17, 2005
6 - *
7 - * This program is free software; you can redistribute it and/or modify
8 - * it under the terms of the GNU General Public License version 2 as
9 - * published by the Free Software Foundation.
10 - */
11 -
12 - .text
13 - .globl arm_sha_transform
14 -
15 -/*
16 - * void sha_transform(uint32_t *hash, const unsigned char *data, uint32_t *W);
17 - *
18 - * note: the "data" pointer may be unaligned.
19 - */
20 -
21 -arm_sha_transform:
22 -
23 - stmfd sp!, {r4 - r8, lr}
24 -
25 - @ for (i = 0; i < 16; i++)
26 - @ W[i] = ntohl(((uint32_t *)data)[i]);
27 -
28 -#ifdef __ARMEB__
29 - mov r4, r0
30 - mov r0, r2
31 - mov r2, #64
32 - bl memcpy
33 - mov r2, r0
34 - mov r0, r4
35 -#else
36 - mov r3, r2
37 - mov lr, #16
38 -1: ldrb r4, [r1], #1
39 - ldrb r5, [r1], #1
40 - ldrb r6, [r1], #1
41 - ldrb r7, [r1], #1
42 - subs lr, lr, #1
43 - orr r5, r5, r4, lsl #8
44 - orr r6, r6, r5, lsl #8
45 - orr r7, r7, r6, lsl #8
46 - str r7, [r3], #4
47 - bne 1b
48 -#endif
49 -
50 - @ for (i = 0; i < 64; i++)
51 - @ W[i+16] = ror(W[i+13] ^ W[i+8] ^ W[i+2] ^ W[i], 31);
52 -
53 - sub r3, r2, #4
54 - mov lr, #64
55 -2: ldr r4, [r3, #4]!
56 - subs lr, lr, #1
57 - ldr r5, [r3, #8]
58 - ldr r6, [r3, #32]
59 - ldr r7, [r3, #52]
60 - eor r4, r4, r5
61 - eor r4, r4, r6
62 - eor r4, r4, r7
63 - mov r4, r4, ror #31
64 - str r4, [r3, #64]
65 - bne 2b
66 -
67 - /*
68 - * The SHA functions are:
69 - *
70 - * f1(B,C,D) = (D ^ (B & (C ^ D)))
71 - * f2(B,C,D) = (B ^ C ^ D)
72 - * f3(B,C,D) = ((B & C) | (D & (B | C)))
73 - *
74 - * Then the sub-blocks are processed as follows:
75 - *
76 - * A' = ror(A, 27) + f(B,C,D) + E + K + *W++
77 - * B' = A
78 - * C' = ror(B, 2)
79 - * D' = C
80 - * E' = D
81 - *
82 - * We therefore unroll each loop 5 times to avoid register shuffling.
83 - * Also the ror for C (and also D and E which are successivelyderived
84 - * from it) is applied in place to cut on an additional mov insn for
85 - * each round.
86 - */
87 -
88 - .macro sha_f1, A, B, C, D, E
89 - ldr r3, [r2], #4
90 - eor ip, \C, \D
91 - add \E, r1, \E, ror #2
92 - and ip, \B, ip, ror #2
93 - add \E, \E, \A, ror #27
94 - eor ip, ip, \D, ror #2
95 - add \E, \E, r3
96 - add \E, \E, ip
97 - .endm
98 -
99 - .macro sha_f2, A, B, C, D, E
100 - ldr r3, [r2], #4
101 - add \E, r1, \E, ror #2
102 - eor ip, \B, \C, ror #2
103 - add \E, \E, \A, ror #27
104 - eor ip, ip, \D, ror #2
105 - add \E, \E, r3
106 - add \E, \E, ip
107 - .endm
108 -
109 - .macro sha_f3, A, B, C, D, E
110 - ldr r3, [r2], #4
111 - add \E, r1, \E, ror #2
112 - orr ip, \B, \C, ror #2
113 - add \E, \E, \A, ror #27
114 - and ip, ip, \D, ror #2
115 - add \E, \E, r3
116 - and r3, \B, \C, ror #2
117 - orr ip, ip, r3
118 - add \E, \E, ip
119 - .endm
120 -
121 - ldmia r0, {r4 - r8}
122 -
123 - mov lr, #4
124 - ldr r1, .L_sha_K + 0
125 -
126 - /* adjust initial values */
127 - mov r6, r6, ror #30
128 - mov r7, r7, ror #30
129 - mov r8, r8, ror #30
130 -
131 -3: subs lr, lr, #1
132 - sha_f1 r4, r5, r6, r7, r8
133 - sha_f1 r8, r4, r5, r6, r7
134 - sha_f1 r7, r8, r4, r5, r6
135 - sha_f1 r6, r7, r8, r4, r5
136 - sha_f1 r5, r6, r7, r8, r4
137 - bne 3b
138 -
139 - ldr r1, .L_sha_K + 4
140 - mov lr, #4
141 -
142 -4: subs lr, lr, #1
143 - sha_f2 r4, r5, r6, r7, r8
144 - sha_f2 r8, r4, r5, r6, r7
145 - sha_f2 r7, r8, r4, r5, r6
146 - sha_f2 r6, r7, r8, r4, r5
147 - sha_f2 r5, r6, r7, r8, r4
148 - bne 4b
149 -
150 - ldr r1, .L_sha_K + 8
151 - mov lr, #4
152 -
153 -5: subs lr, lr, #1
154 - sha_f3 r4, r5, r6, r7, r8
155 - sha_f3 r8, r4, r5, r6, r7
156 - sha_f3 r7, r8, r4, r5, r6
157 - sha_f3 r6, r7, r8, r4, r5
158 - sha_f3 r5, r6, r7, r8, r4
159 - bne 5b
160 -
161 - ldr r1, .L_sha_K + 12
162 - mov lr, #4
163 -
164 -6: subs lr, lr, #1
165 - sha_f2 r4, r5, r6, r7, r8
166 - sha_f2 r8, r4, r5, r6, r7
167 - sha_f2 r7, r8, r4, r5, r6
168 - sha_f2 r6, r7, r8, r4, r5
169 - sha_f2 r5, r6, r7, r8, r4
170 - bne 6b
171 -
172 - ldmia r0, {r1, r2, r3, ip, lr}
173 - add r4, r1, r4
174 - add r5, r2, r5
175 - add r6, r3, r6, ror #2
176 - add r7, ip, r7, ror #2
177 - add r8, lr, r8, ror #2
178 - stmia r0, {r4 - r8}
179 -
180 - ldmfd sp!, {r4 - r8, pc}
181 -
182 -.L_sha_K:
183 - .word 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6
block-sha1/sha1.c
+4 -2
@@ -1,7 +1,9 @@
1 /*
2 - * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.c),
3 - * optimized to do word accesses rather than byte accesses,
2 + * SHA1 routine optimized to do word accesses rather than byte accesses,
3 * and to avoid unnecessary copies into the context array.
4 + *
5 + * This was initially based on the Mozilla SHA1 implementation, although
6 + * none of the original Mozilla code remains.
7 */
8
9 /* this is only to get definitions for memcpy(), ntohl() and htonl() */
block-sha1/sha1.h
+4 -2
@@ -1,7 +1,9 @@
1 /*
2 - * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.h),
3 - * optimized to do word accesses rather than byte accesses,
2 + * SHA1 routine optimized to do word accesses rather than byte accesses,
3 * and to avoid unnecessary copies into the context array.
4 + *
5 + * This was initially based on the Mozilla SHA1 implementation, although
6 + * none of the original Mozilla code remains.
7 */
8
9 typedef struct {
configure.ac
+1 -9
@@ -156,19 +156,11 @@ AC_MSG_NOTICE([CHECKS for site configuration])
156 # tests. These tests take up a significant amount of the total test time
157 # but are not needed unless you plan to talk to SVN repos.
158 #
159 -# Define MOZILLA_SHA1 environment variable when running make to make use of
160 -# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
161 -# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
162 -# choice) has very fast version optimized for i586.
163 -#
159 # Define PPC_SHA1 environment variable when running make to make use of
160 # a bundled SHA1 routine optimized for PowerPC.
161 #
167 -# Define ARM_SHA1 environment variable when running make to make use of
168 -# a bundled SHA1 routine optimized for ARM.
169 -#
162 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
171 -# This also implies MOZILLA_SHA1.
163 +# This also implies BLK_SHA1.
164 #
165 # Define OPENSSLDIR=/foo/bar if your openssl header and library files are in
166 # /foo/bar/include and /foo/bar/lib directories.
mozilla-sha1/sha1.c deleted
-151
@@ -1,151 +0,0 @@
1 -/*
2 - * The contents of this file are subject to the Mozilla Public
3 - * License Version 1.1 (the "License"); you may not use this file
4 - * except in compliance with the License. You may obtain a copy of
5 - * the License at http://www.mozilla.org/MPL/
6 - *
7 - * Software distributed under the License is distributed on an "AS
8 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 - * implied. See the License for the specific language governing
10 - * rights and limitations under the License.
11 - *
12 - * The Original Code is SHA 180-1 Reference Implementation (Compact version)
13 - *
14 - * The Initial Developer of the Original Code is Paul Kocher of
15 - * Cryptography Research. Portions created by Paul Kocher are
16 - * Copyright (C) 1995-9 by Cryptography Research, Inc. All
17 - * Rights Reserved.
18 - *
19 - * Contributor(s):
20 - *
21 - * Paul Kocher
22 - *
23 - * Alternatively, the contents of this file may be used under the
24 - * terms of the GNU General Public License Version 2 or later (the
25 - * "GPL"), in which case the provisions of the GPL are applicable
26 - * instead of those above. If you wish to allow use of your
27 - * version of this file only under the terms of the GPL and not to
28 - * allow others to use your version of this file under the MPL,
29 - * indicate your decision by deleting the provisions above and
30 - * replace them with the notice and other provisions required by
31 - * the GPL. If you do not delete the provisions above, a recipient
32 - * may use your version of this file under either the MPL or the
33 - * GPL.
34 - */
35 -
36 -#include "sha1.h"
37 -
38 -static void shaHashBlock(moz_SHA_CTX *ctx);
39 -
40 -void moz_SHA1_Init(moz_SHA_CTX *ctx) {
41 - int i;
42 -
43 - ctx->lenW = 0;
44 - ctx->sizeHi = ctx->sizeLo = 0;
45 -
46 - /* Initialize H with the magic constants (see FIPS180 for constants)
47 - */
48 - ctx->H[0] = 0x67452301;
49 - ctx->H[1] = 0xefcdab89;
50 - ctx->H[2] = 0x98badcfe;
51 - ctx->H[3] = 0x10325476;
52 - ctx->H[4] = 0xc3d2e1f0;
53 -
54 - for (i = 0; i < 80; i++)
55 - ctx->W[i] = 0;
56 -}
57 -
58 -
59 -void moz_SHA1_Update(moz_SHA_CTX *ctx, const void *_dataIn, int len) {
60 - const unsigned char *dataIn = _dataIn;
61 - int i;
62 -
63 - /* Read the data into W and process blocks as they get full
64 - */
65 - for (i = 0; i < len; i++) {
66 - ctx->W[ctx->lenW / 4] <<= 8;
67 - ctx->W[ctx->lenW / 4] |= (unsigned int)dataIn[i];
68 - if ((++ctx->lenW) % 64 == 0) {
69 - shaHashBlock(ctx);
70 - ctx->lenW = 0;
71 - }
72 - ctx->sizeLo += 8;
73 - ctx->sizeHi += (ctx->sizeLo < 8);
74 - }
75 -}
76 -
77 -
78 -void moz_SHA1_Final(unsigned char hashout[20], moz_SHA_CTX *ctx) {
79 - unsigned char pad0x80 = 0x80;
80 - unsigned char pad0x00 = 0x00;
81 - unsigned char padlen[8];
82 - int i;
83 -
84 - /* Pad with a binary 1 (e.g. 0x80), then zeroes, then length
85 - */
86 - padlen[0] = (unsigned char)((ctx->sizeHi >> 24) & 255);
87 - padlen[1] = (unsigned char)((ctx->sizeHi >> 16) & 255);
88 - padlen[2] = (unsigned char)((ctx->sizeHi >> 8) & 255);
89 - padlen[3] = (unsigned char)((ctx->sizeHi >> 0) & 255);
90 - padlen[4] = (unsigned char)((ctx->sizeLo >> 24) & 255);
91 - padlen[5] = (unsigned char)((ctx->sizeLo >> 16) & 255);
92 - padlen[6] = (unsigned char)((ctx->sizeLo >> 8) & 255);
93 - padlen[7] = (unsigned char)((ctx->sizeLo >> 0) & 255);
94 - moz_SHA1_Update(ctx, &pad0x80, 1);
95 - while (ctx->lenW != 56)
96 - moz_SHA1_Update(ctx, &pad0x00, 1);
97 - moz_SHA1_Update(ctx, padlen, 8);
98 -
99 - /* Output hash
100 - */
101 - for (i = 0; i < 20; i++) {
102 - hashout[i] = (unsigned char)(ctx->H[i / 4] >> 24);
103 - ctx->H[i / 4] <<= 8;
104 - }
105 -
106 - /*
107 - * Re-initialize the context (also zeroizes contents)
108 - */
109 - moz_SHA1_Init(ctx);
110 -}
111 -
112 -
113 -#define SHA_ROT(X,n) (((X) << (n)) | ((X) >> (32-(n))))
114 -
115 -static void shaHashBlock(moz_SHA_CTX *ctx) {
116 - int t;
117 - unsigned int A,B,C,D,E,TEMP;
118 -
119 - for (t = 16; t <= 79; t++)
120 - ctx->W[t] =
121 - SHA_ROT(ctx->W[t-3] ^ ctx->W[t-8] ^ ctx->W[t-14] ^ ctx->W[t-16], 1);
122 -
123 - A = ctx->H[0];
124 - B = ctx->H[1];
125 - C = ctx->H[2];
126 - D = ctx->H[3];
127 - E = ctx->H[4];
128 -
129 - for (t = 0; t <= 19; t++) {
130 - TEMP = SHA_ROT(A,5) + (((C^D)&B)^D) + E + ctx->W[t] + 0x5a827999;
131 - E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
132 - }
133 - for (t = 20; t <= 39; t++) {
134 - TEMP = SHA_ROT(A,5) + (B^C^D) + E + ctx->W[t] + 0x6ed9eba1;
135 - E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
136 - }
137 - for (t = 40; t <= 59; t++) {
138 - TEMP = SHA_ROT(A,5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdc;
139 - E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
140 - }
141 - for (t = 60; t <= 79; t++) {
142 - TEMP = SHA_ROT(A,5) + (B^C^D) + E + ctx->W[t] + 0xca62c1d6;
143 - E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
144 - }
145 -
146 - ctx->H[0] += A;
147 - ctx->H[1] += B;
148 - ctx->H[2] += C;
149 - ctx->H[3] += D;
150 - ctx->H[4] += E;
151 -}
mozilla-sha1/sha1.h deleted
-50
@@ -1,50 +0,0 @@
1 -/*
2 - * The contents of this file are subject to the Mozilla Public
3 - * License Version 1.1 (the "License"); you may not use this file
4 - * except in compliance with the License. You may obtain a copy of
5 - * the License at http://www.mozilla.org/MPL/
6 - *
7 - * Software distributed under the License is distributed on an "AS
8 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 - * implied. See the License for the specific language governing
10 - * rights and limitations under the License.
11 - *
12 - * The Original Code is SHA 180-1 Header File
13 - *
14 - * The Initial Developer of the Original Code is Paul Kocher of
15 - * Cryptography Research. Portions created by Paul Kocher are
16 - * Copyright (C) 1995-9 by Cryptography Research, Inc. All
17 - * Rights Reserved.
18 - *
19 - * Contributor(s):
20 - *
21 - * Paul Kocher
22 - *
23 - * Alternatively, the contents of this file may be used under the
24 - * terms of the GNU General Public License Version 2 or later (the
25 - * "GPL"), in which case the provisions of the GPL are applicable
26 - * instead of those above. If you wish to allow use of your
27 - * version of this file only under the terms of the GPL and not to
28 - * allow others to use your version of this file under the MPL,
29 - * indicate your decision by deleting the provisions above and
30 - * replace them with the notice and other provisions required by
31 - * the GPL. If you do not delete the provisions above, a recipient
32 - * may use your version of this file under either the MPL or the
33 - * GPL.
34 - */
35 -
36 -typedef struct {
37 - unsigned int H[5];
38 - unsigned int W[80];
39 - int lenW;
40 - unsigned int sizeHi,sizeLo;
41 -} moz_SHA_CTX;
42 -
43 -void moz_SHA1_Init(moz_SHA_CTX *ctx);
44 -void moz_SHA1_Update(moz_SHA_CTX *ctx, const void *dataIn, int len);
45 -void moz_SHA1_Final(unsigned char hashout[20], moz_SHA_CTX *ctx);
46 -
47 -#define git_SHA_CTX moz_SHA_CTX
48 -#define git_SHA1_Init moz_SHA1_Init
49 -#define git_SHA1_Update moz_SHA1_Update
50 -#define git_SHA1_Final moz_SHA1_Final