Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a4cc54

Browse files
committed
Eliminate some of the more blatant platform-dependencies ... it builds here now, anyway ...
1 parent2bf2ee7 commit7a4cc54

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
lines changed

‎contrib/pgcrypto/md5.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*$KAME: md5.c,v 1.3 2000/02/22 14:01:17 itojun Exp $*/
1+
/*$Id: md5.c,v 1.2 2000/12/0401:20:38 tgl Exp $*/
22

33
/*
44
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
9191
#defineMD5_D00x10325476
9292

9393
/* Integer part of 4294967296 times abs(sin(i)), where i is in radians. */
94-
staticconstu_int32_tT[65]= {
94+
staticconstuint32_tT[65]= {
9595
0,
9696
0xd76aa478,0xe8c7b756,0x242070db,0xc1bdceee,
9797
0xf57c0faf,0x4787c62a,0xa8304613,0xfd469501,
@@ -114,7 +114,7 @@ static const u_int32_t T[65] = {
114114
0xf7537e82,0xbd3af235,0x2ad7d2bb,0xeb86d391,
115115
};
116116

117-
staticconstu_int8_tmd5_paddat[MD5_BUFLEN]= {
117+
staticconstuint8_tmd5_paddat[MD5_BUFLEN]= {
118118
0x80,0,0,0,0,0,0,0,
119119
0,0,0,0,0,0,0,0,
120120
0,0,0,0,0,0,0,0,
@@ -125,7 +125,7 @@ static const u_int8_t md5_paddat[MD5_BUFLEN] = {
125125
0,0,0,0,0,0,0,0,
126126
};
127127

128-
staticvoidmd5_calc__P((u_int8_t*,md5_ctxt*));
128+
staticvoidmd5_calc(uint8_t*,md5_ctxt*);
129129

130130
voidmd5_init(ctxt)
131131
md5_ctxt*ctxt;
@@ -141,10 +141,10 @@ void md5_init(ctxt)
141141

142142
voidmd5_loop(ctxt,input,len)
143143
md5_ctxt*ctxt;
144-
u_int8_t*input;
145-
u_intlen;/* number of bytes */
144+
uint8_t*input;
145+
unsignedintlen;/* number of bytes */
146146
{
147-
u_intgap,i;
147+
unsignedintgap,i;
148148

149149
ctxt->md5_n+=len*8;/* byte to bit */
150150
gap=MD5_BUFLEN-ctxt->md5_i;
@@ -155,7 +155,7 @@ void md5_loop(ctxt, input, len)
155155
md5_calc(ctxt->md5_buf,ctxt);
156156

157157
for (i=gap;i+MD5_BUFLEN <=len;i+=MD5_BUFLEN) {
158-
md5_calc((u_int8_t*)(input+i),ctxt);
158+
md5_calc((uint8_t*)(input+i),ctxt);
159159
}
160160

161161
ctxt->md5_i=len-i;
@@ -170,7 +170,7 @@ void md5_loop(ctxt, input, len)
170170
voidmd5_pad(ctxt)
171171
md5_ctxt*ctxt;
172172
{
173-
u_intgap;
173+
unsignedintgap;
174174

175175
/* Don't count up padding. Keep md5_n. */
176176
gap=MD5_BUFLEN-ctxt->md5_i;
@@ -207,7 +207,7 @@ void md5_pad(ctxt)
207207
}
208208

209209
voidmd5_result(digest,ctxt)
210-
u_int8_t*digest;
210+
uint8_t*digest;
211211
md5_ctxt*ctxt;
212212
{
213213
/* 4 byte words */
@@ -227,24 +227,24 @@ void md5_result(digest, ctxt)
227227
}
228228

229229
#ifBYTE_ORDER==BIG_ENDIAN
230-
u_int32_tX[16];
230+
uint32_tX[16];
231231
#endif
232232

233233
staticvoidmd5_calc(b64,ctxt)
234-
u_int8_t*b64;
234+
uint8_t*b64;
235235
md5_ctxt*ctxt;
236236
{
237-
u_int32_tA=ctxt->md5_sta;
238-
u_int32_tB=ctxt->md5_stb;
239-
u_int32_tC=ctxt->md5_stc;
240-
u_int32_tD=ctxt->md5_std;
237+
uint32_tA=ctxt->md5_sta;
238+
uint32_tB=ctxt->md5_stb;
239+
uint32_tC=ctxt->md5_stc;
240+
uint32_tD=ctxt->md5_std;
241241
#ifBYTE_ORDER==LITTLE_ENDIAN
242-
u_int32_t*X= (u_int32_t*)b64;
242+
uint32_t*X= (uint32_t*)b64;
243243
#endif
244244
#ifBYTE_ORDER==BIG_ENDIAN
245245
/* 4 byte words */
246246
/* what a brute force but fast! */
247-
u_int8_t*y= (u_int8_t*)X;
247+
uint8_t*y= (uint8_t*)X;
248248
y[0]=b64[3];y[1]=b64[2];y[2]=b64[1];y[3]=b64[0];
249249
y[4]=b64[7];y[5]=b64[6];y[6]=b64[5];y[7]=b64[4];
250250
y[8]=b64[11];y[9]=b64[10];y[10]=b64[9];y[11]=b64[8];

‎contrib/pgcrypto/md5.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*$KAME: md5.h,v 1.3 2000/02/22 14:01:18 itojun Exp $*/
1+
/*$Id: md5.h,v 1.2 2000/12/0401:20:38 tgl Exp $*/
22

33
/*
44
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -36,8 +36,8 @@
3636

3737
typedefstruct {
3838
union {
39-
u_int32_tmd5_state32[4];
40-
u_int8_tmd5_state8[16];
39+
uint32_tmd5_state32[4];
40+
uint8_tmd5_state8[16];
4141
}md5_st;
4242

4343
#definemd5_stamd5_st.md5_state32[0]
@@ -47,20 +47,20 @@ typedef struct {
4747
#definemd5_st8md5_st.md5_state8
4848

4949
union {
50-
u_int64_tmd5_count64;
51-
u_int8_tmd5_count8[8];
50+
uint64_tmd5_count64;
51+
uint8_tmd5_count8[8];
5252
}md5_count;
5353
#definemd5_nmd5_count.md5_count64
5454
#definemd5_n8md5_count.md5_count8
5555

56-
u_intmd5_i;
57-
u_int8_tmd5_buf[MD5_BUFLEN];
56+
unsignedintmd5_i;
57+
uint8_tmd5_buf[MD5_BUFLEN];
5858
}md5_ctxt;
5959

60-
externvoidmd5_init__P((md5_ctxt*));
61-
externvoidmd5_loop__P((md5_ctxt*,u_int8_t*,u_int));
62-
externvoidmd5_pad__P((md5_ctxt*));
63-
externvoidmd5_result__P((u_int8_t*,md5_ctxt*));
60+
externvoidmd5_init(md5_ctxt*);
61+
externvoidmd5_loop(md5_ctxt*,uint8_t*,unsignedint);
62+
externvoidmd5_pad(md5_ctxt*);
63+
externvoidmd5_result(uint8_t*,md5_ctxt*);
6464

6565
/* compatibility */
6666
#defineMD5_CTXmd5_ctxt

‎contrib/pgcrypto/sha1.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*$KAME: sha1.c,v 1.3 2000/02/22 14:01:18 itojun Exp $*/
1+
/*$Id: sha1.c,v 1.2 2000/12/0401:20:38 tgl Exp $*/
22

33
/*
44
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -49,7 +49,7 @@
4949
#ifndefunsupported
5050

5151
/* constant table */
52-
staticu_int32_t_K[]= {0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6 };
52+
staticuint32_t_K[]= {0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6 };
5353
#defineK(t)_K[(t) / 20]
5454

5555
#defineF0(b,c,d)(((b) & (c)) | ((~(b)) & (d)))
@@ -81,15 +81,15 @@ static u_int32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
8181
sha1_step(ctxt);\
8282
}
8383

84-
staticvoidsha1_step__P((structsha1_ctxt*));
84+
staticvoidsha1_step(structsha1_ctxt*);
8585

8686
staticvoid
8787
sha1_step(ctxt)
8888
structsha1_ctxt*ctxt;
8989
{
90-
u_int32_ta,b,c,d,e;
90+
uint32_ta,b,c,d,e;
9191
size_tt,s;
92-
u_int32_ttmp;
92+
uint32_ttmp;
9393

9494
#ifBYTE_ORDER==LITTLE_ENDIAN
9595
structsha1_ctxttctxt;
@@ -221,13 +221,13 @@ sha1_loop(ctxt, input0, len)
221221
constcaddr_tinput0;
222222
size_tlen;
223223
{
224-
constu_int8_t*input;
224+
constuint8_t*input;
225225
size_tgaplen;
226226
size_tgapstart;
227227
size_toff;
228228
size_tcopysiz;
229229

230-
input= (constu_int8_t*)input0;
230+
input= (constuint8_t*)input0;
231231
off=0;
232232

233233
while (off<len) {
@@ -250,9 +250,9 @@ sha1_result(ctxt, digest0)
250250
structsha1_ctxt*ctxt;
251251
caddr_tdigest0;
252252
{
253-
u_int8_t*digest;
253+
uint8_t*digest;
254254

255-
digest= (u_int8_t*)digest0;
255+
digest= (uint8_t*)digest0;
256256
sha1_pad(ctxt);
257257
#ifBYTE_ORDER==BIG_ENDIAN
258258
bcopy(&ctxt->h.b8[0],digest,20);

‎contrib/pgcrypto/sha1.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*$KAME: sha1.h,v 1.4 2000/02/22 14:01:18 itojun Exp $*/
1+
/*$Id: sha1.h,v 1.2 2000/12/0401:20:38 tgl Exp $*/
22

33
/*
44
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -39,24 +39,24 @@
3939

4040
structsha1_ctxt {
4141
union {
42-
u_int8_tb8[20];
43-
u_int32_tb32[5];
42+
uint8_tb8[20];
43+
uint32_tb32[5];
4444
}h;
4545
union {
46-
u_int8_tb8[8];
47-
u_int64_tb64[1];
46+
uint8_tb8[8];
47+
uint64_tb64[1];
4848
}c;
4949
union {
50-
u_int8_tb8[64];
51-
u_int32_tb32[16];
50+
uint8_tb8[64];
51+
uint32_tb32[16];
5252
}m;
53-
u_int8_tcount;
53+
uint8_tcount;
5454
};
5555

56-
externvoidsha1_init__P((structsha1_ctxt*));
57-
externvoidsha1_pad__P((structsha1_ctxt*));
58-
externvoidsha1_loop__P((structsha1_ctxt*,constcaddr_t,size_t));
59-
externvoidsha1_result__P((structsha1_ctxt*,caddr_t));
56+
externvoidsha1_init(structsha1_ctxt*);
57+
externvoidsha1_pad(structsha1_ctxt*);
58+
externvoidsha1_loop(structsha1_ctxt*,constcaddr_t,size_t);
59+
externvoidsha1_result(structsha1_ctxt*,caddr_t);
6060

6161
/* compatibilty with other SHA1 source codes */
6262
typedefstructsha1_ctxtSHA1_CTX;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp