Commit 780e264fa42961c482e0d7266c5bde26d1939971
1 parent
fb48f71b
Ansify to please sparse
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5551 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
19 deletions
d3des.c
@@ -63,9 +63,8 @@ static const unsigned char pc2[48] = { | @@ -63,9 +63,8 @@ static const unsigned char pc2[48] = { | ||
63 | 40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47, | 63 | 40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47, |
64 | 43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 }; | 64 | 43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 }; |
65 | 65 | ||
66 | -void deskey(key, edf) /* Thanks to James Gillogly & Phil Karn! */ | ||
67 | -unsigned char *key; | ||
68 | -int edf; | 66 | +/* Thanks to James Gillogly & Phil Karn! */ |
67 | +void deskey(unsigned char *key, int edf) | ||
69 | { | 68 | { |
70 | register int i, j, l, m, n; | 69 | register int i, j, l, m, n; |
71 | unsigned char pc1m[56], pcr[56]; | 70 | unsigned char pc1m[56], pcr[56]; |
@@ -100,8 +99,7 @@ int edf; | @@ -100,8 +99,7 @@ int edf; | ||
100 | return; | 99 | return; |
101 | } | 100 | } |
102 | 101 | ||
103 | -static void cookey(raw1) | ||
104 | -register unsigned long *raw1; | 102 | +static void cookey(register unsigned long *raw1) |
105 | { | 103 | { |
106 | register unsigned long *cook, *raw0; | 104 | register unsigned long *cook, *raw0; |
107 | unsigned long dough[32]; | 105 | unsigned long dough[32]; |
@@ -123,8 +121,7 @@ register unsigned long *raw1; | @@ -123,8 +121,7 @@ register unsigned long *raw1; | ||
123 | return; | 121 | return; |
124 | } | 122 | } |
125 | 123 | ||
126 | -void cpkey(into) | ||
127 | -register unsigned long *into; | 124 | +void cpkey(register unsigned long *into) |
128 | { | 125 | { |
129 | register unsigned long *from, *endp; | 126 | register unsigned long *from, *endp; |
130 | 127 | ||
@@ -133,8 +130,7 @@ register unsigned long *into; | @@ -133,8 +130,7 @@ register unsigned long *into; | ||
133 | return; | 130 | return; |
134 | } | 131 | } |
135 | 132 | ||
136 | -void usekey(from) | ||
137 | -register unsigned long *from; | 133 | +void usekey(register unsigned long *from) |
138 | { | 134 | { |
139 | register unsigned long *to, *endp; | 135 | register unsigned long *to, *endp; |
140 | 136 | ||
@@ -143,8 +139,7 @@ register unsigned long *from; | @@ -143,8 +139,7 @@ register unsigned long *from; | ||
143 | return; | 139 | return; |
144 | } | 140 | } |
145 | 141 | ||
146 | -void des(inblock, outblock) | ||
147 | -unsigned char *inblock, *outblock; | 142 | +void des(unsigned char *inblock, unsigned char *outblock) |
148 | { | 143 | { |
149 | unsigned long work[2]; | 144 | unsigned long work[2]; |
150 | 145 | ||
@@ -154,9 +149,7 @@ unsigned char *inblock, *outblock; | @@ -154,9 +149,7 @@ unsigned char *inblock, *outblock; | ||
154 | return; | 149 | return; |
155 | } | 150 | } |
156 | 151 | ||
157 | -static void scrunch(outof, into) | ||
158 | -register unsigned char *outof; | ||
159 | -register unsigned long *into; | 152 | +static void scrunch(register unsigned char *outof, register unsigned long *into) |
160 | { | 153 | { |
161 | *into = (*outof++ & 0xffL) << 24; | 154 | *into = (*outof++ & 0xffL) << 24; |
162 | *into |= (*outof++ & 0xffL) << 16; | 155 | *into |= (*outof++ & 0xffL) << 16; |
@@ -169,9 +162,7 @@ register unsigned long *into; | @@ -169,9 +162,7 @@ register unsigned long *into; | ||
169 | return; | 162 | return; |
170 | } | 163 | } |
171 | 164 | ||
172 | -static void unscrun(outof, into) | ||
173 | -register unsigned long *outof; | ||
174 | -register unsigned char *into; | 165 | +static void unscrun(register unsigned long *outof, register unsigned char *into) |
175 | { | 166 | { |
176 | *into++ = (unsigned char)((*outof >> 24) & 0xffL); | 167 | *into++ = (unsigned char)((*outof >> 24) & 0xffL); |
177 | *into++ = (unsigned char)((*outof >> 16) & 0xffL); | 168 | *into++ = (unsigned char)((*outof >> 16) & 0xffL); |
@@ -328,8 +319,7 @@ static const unsigned long SP8[64] = { | @@ -328,8 +319,7 @@ static const unsigned long SP8[64] = { | ||
328 | 0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L, | 319 | 0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L, |
329 | 0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L }; | 320 | 0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L }; |
330 | 321 | ||
331 | -static void desfunc(block, keys) | ||
332 | -register unsigned long *block, *keys; | 322 | +static void desfunc(register unsigned long *block, register unsigned long *keys) |
333 | { | 323 | { |
334 | register unsigned long fval, work, right, leftt; | 324 | register unsigned long fval, work, right, leftt; |
335 | register int round; | 325 | register int round; |