Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

rmd160.c
Go to the documentation of this file.
1 /* $NetBSD: rmd160.c,v 1.1.1.1 2001/03/06 11:21:05 agc Exp $ */
2 /* $RoughId: rmd160.c,v 1.2 2001/07/13 19:49:10 knu Exp $ */
3 /* $Id: rmd160.c 35554 2012-05-07 01:27:59Z nobu $ */
4
5 /********************************************************************\
6 *
7 * FILE: rmd160.c
8 *
9 * CONTENTS: A sample C-implementation of the RIPEMD-160
10 * hash-function.
11 * TARGET: any computer with an ANSI C compiler
12 *
13 * AUTHOR: Antoon Bosselaers, ESAT-COSIC
14 * (Arranged for libc by Todd C. Miller)
15 * DATE: 1 March 1996
16 * VERSION: 1.0
17 *
18 * Copyright (c) Katholieke Universiteit Leuven
19 * 1996, All Rights Reserved
20 *
21 \********************************************************************/
22
23 #include "rmd160.h"
24
25 #ifndef lint
26 /* __RCSID("$NetBSD: rmd160.c,v 1.1.1.1 2001/03/06 11:21:05 agc Exp $"); */
27 #endif /* not lint */
28
29 /* header files */
30
31 #ifdef HAVE_SYS_ENDIAN_H_
32 #include <sys/endian.h>
33 #endif
34
35 #ifdef HAVE_MACHINE_ENDIAN_H_
36 #include <machine/endian.h>
37 #endif
38
39 /* #include "namespace.h" */
40
41 #include <assert.h>
42 #include <stdio.h>
43 #include <stdlib.h>
44 #include <string.h>
45
46 #ifndef _DIAGASSERT
47 #define _DIAGASSERT(cond) assert(cond)
48 #endif
49
50
51 /********************************************************************/
52
53 /* macro definitions */
54
55 /* collect four bytes into one word: */
56 #define BYTES_TO_DWORD(strptr) \
57 (((uint32_t) *((strptr)+3) << 24) | \
58 ((uint32_t) *((strptr)+2) << 16) | \
59 ((uint32_t) *((strptr)+1) << 8) | \
60 ((uint32_t) *(strptr)))
61
62 /* ROL(x, n) cyclically rotates x over n bits to the left */
63 /* x must be of an unsigned 32 bits type and 0 <= n < 32. */
64 #define ROL(x, n) (((x) << (n)) | ((x) >> (32-(n))))
65
66 /* the three basic functions F(), G() and H() */
67 #define F(x, y, z) ((x) ^ (y) ^ (z))
68 #define G(x, y, z) (((x) & (y)) | (~(x) & (z)))
69 #define H(x, y, z) (((x) | ~(y)) ^ (z))
70 #define I(x, y, z) (((x) & (z)) | ((y) & ~(z)))
71 #define J(x, y, z) ((x) ^ ((y) | ~(z)))
72
73 /* the eight basic operations FF() through III() */
74 #define FF(a, b, c, d, e, x, s) { \
75 (a) += F((b), (c), (d)) + (x); \
76 (a) = ROL((a), (s)) + (e); \
77 (c) = ROL((c), 10); \
78 }
79 #define GG(a, b, c, d, e, x, s) { \
80 (a) += G((b), (c), (d)) + (x) + 0x5a827999U; \
81 (a) = ROL((a), (s)) + (e); \
82 (c) = ROL((c), 10); \
83 }
84 #define HH(a, b, c, d, e, x, s) { \
85 (a) += H((b), (c), (d)) + (x) + 0x6ed9eba1U; \
86 (a) = ROL((a), (s)) + (e); \
87 (c) = ROL((c), 10); \
88 }
89 #define II(a, b, c, d, e, x, s) { \
90 (a) += I((b), (c), (d)) + (x) + 0x8f1bbcdcU; \
91 (a) = ROL((a), (s)) + (e); \
92 (c) = ROL((c), 10); \
93 }
94 #define JJ(a, b, c, d, e, x, s) { \
95 (a) += J((b), (c), (d)) + (x) + 0xa953fd4eU; \
96 (a) = ROL((a), (s)) + (e); \
97 (c) = ROL((c), 10); \
98 }
99 #define FFF(a, b, c, d, e, x, s) { \
100 (a) += F((b), (c), (d)) + (x); \
101 (a) = ROL((a), (s)) + (e); \
102 (c) = ROL((c), 10); \
103 }
104 #define GGG(a, b, c, d, e, x, s) { \
105 (a) += G((b), (c), (d)) + (x) + 0x7a6d76e9U; \
106 (a) = ROL((a), (s)) + (e); \
107 (c) = ROL((c), 10); \
108 }
109 #define HHH(a, b, c, d, e, x, s) { \
110 (a) += H((b), (c), (d)) + (x) + 0x6d703ef3U; \
111 (a) = ROL((a), (s)) + (e); \
112 (c) = ROL((c), 10); \
113 }
114 #define III(a, b, c, d, e, x, s) { \
115 (a) += I((b), (c), (d)) + (x) + 0x5c4dd124U; \
116 (a) = ROL((a), (s)) + (e); \
117 (c) = ROL((c), 10); \
118 }
119 #define JJJ(a, b, c, d, e, x, s) { \
120 (a) += J((b), (c), (d)) + (x) + 0x50a28be6U; \
121 (a) = ROL((a), (s)) + (e); \
122 (c) = ROL((c), 10); \
123 }
124
125 /********************************************************************/
126
127 void
128 RMD160_Init(RMD160_CTX *context)
129 {
130
131 _DIAGASSERT(context != NULL);
132
133 /* ripemd-160 initialization constants */
134 context->state[0] = 0x67452301U;
135 context->state[1] = 0xefcdab89U;
136 context->state[2] = 0x98badcfeU;
137 context->state[3] = 0x10325476U;
138 context->state[4] = 0xc3d2e1f0U;
139 context->length[0] = context->length[1] = 0;
140 context->buflen = 0;
141 }
142
143 /********************************************************************/
144
145 void
146 RMD160_Transform(uint32_t state[5], const uint32_t block[16])
147 {
148 uint32_t aa, bb, cc, dd, ee;
149 uint32_t aaa, bbb, ccc, ddd, eee;
150
151 _DIAGASSERT(state != NULL);
152 _DIAGASSERT(block != NULL);
153
154 aa = aaa = state[0];
155 bb = bbb = state[1];
156 cc = ccc = state[2];
157 dd = ddd = state[3];
158 ee = eee = state[4];
159
160 /* round 1 */
161 FF(aa, bb, cc, dd, ee, block[ 0], 11);
162 FF(ee, aa, bb, cc, dd, block[ 1], 14);
163 FF(dd, ee, aa, bb, cc, block[ 2], 15);
164 FF(cc, dd, ee, aa, bb, block[ 3], 12);
165 FF(bb, cc, dd, ee, aa, block[ 4], 5);
166 FF(aa, bb, cc, dd, ee, block[ 5], 8);
167 FF(ee, aa, bb, cc, dd, block[ 6], 7);
168 FF(dd, ee, aa, bb, cc, block[ 7], 9);
169 FF(cc, dd, ee, aa, bb, block[ 8], 11);
170 FF(bb, cc, dd, ee, aa, block[ 9], 13);
171 FF(aa, bb, cc, dd, ee, block[10], 14);
172 FF(ee, aa, bb, cc, dd, block[11], 15);
173 FF(dd, ee, aa, bb, cc, block[12], 6);
174 FF(cc, dd, ee, aa, bb, block[13], 7);
175 FF(bb, cc, dd, ee, aa, block[14], 9);
176 FF(aa, bb, cc, dd, ee, block[15], 8);
177
178 /* round 2 */
179 GG(ee, aa, bb, cc, dd, block[ 7], 7);
180 GG(dd, ee, aa, bb, cc, block[ 4], 6);
181 GG(cc, dd, ee, aa, bb, block[13], 8);
182 GG(bb, cc, dd, ee, aa, block[ 1], 13);
183 GG(aa, bb, cc, dd, ee, block[10], 11);
184 GG(ee, aa, bb, cc, dd, block[ 6], 9);
185 GG(dd, ee, aa, bb, cc, block[15], 7);
186 GG(cc, dd, ee, aa, bb, block[ 3], 15);
187 GG(bb, cc, dd, ee, aa, block[12], 7);
188 GG(aa, bb, cc, dd, ee, block[ 0], 12);
189 GG(ee, aa, bb, cc, dd, block[ 9], 15);
190 GG(dd, ee, aa, bb, cc, block[ 5], 9);
191 GG(cc, dd, ee, aa, bb, block[ 2], 11);
192 GG(bb, cc, dd, ee, aa, block[14], 7);
193 GG(aa, bb, cc, dd, ee, block[11], 13);
194 GG(ee, aa, bb, cc, dd, block[ 8], 12);
195
196 /* round 3 */
197 HH(dd, ee, aa, bb, cc, block[ 3], 11);
198 HH(cc, dd, ee, aa, bb, block[10], 13);
199 HH(bb, cc, dd, ee, aa, block[14], 6);
200 HH(aa, bb, cc, dd, ee, block[ 4], 7);
201 HH(ee, aa, bb, cc, dd, block[ 9], 14);
202 HH(dd, ee, aa, bb, cc, block[15], 9);
203 HH(cc, dd, ee, aa, bb, block[ 8], 13);
204 HH(bb, cc, dd, ee, aa, block[ 1], 15);
205 HH(aa, bb, cc, dd, ee, block[ 2], 14);
206 HH(ee, aa, bb, cc, dd, block[ 7], 8);
207 HH(dd, ee, aa, bb, cc, block[ 0], 13);
208 HH(cc, dd, ee, aa, bb, block[ 6], 6);
209 HH(bb, cc, dd, ee, aa, block[13], 5);
210 HH(aa, bb, cc, dd, ee, block[11], 12);
211 HH(ee, aa, bb, cc, dd, block[ 5], 7);
212 HH(dd, ee, aa, bb, cc, block[12], 5);
213
214 /* round 4 */
215 II(cc, dd, ee, aa, bb, block[ 1], 11);
216 II(bb, cc, dd, ee, aa, block[ 9], 12);
217 II(aa, bb, cc, dd, ee, block[11], 14);
218 II(ee, aa, bb, cc, dd, block[10], 15);
219 II(dd, ee, aa, bb, cc, block[ 0], 14);
220 II(cc, dd, ee, aa, bb, block[ 8], 15);
221 II(bb, cc, dd, ee, aa, block[12], 9);
222 II(aa, bb, cc, dd, ee, block[ 4], 8);
223 II(ee, aa, bb, cc, dd, block[13], 9);
224 II(dd, ee, aa, bb, cc, block[ 3], 14);
225 II(cc, dd, ee, aa, bb, block[ 7], 5);
226 II(bb, cc, dd, ee, aa, block[15], 6);
227 II(aa, bb, cc, dd, ee, block[14], 8);
228 II(ee, aa, bb, cc, dd, block[ 5], 6);
229 II(dd, ee, aa, bb, cc, block[ 6], 5);
230 II(cc, dd, ee, aa, bb, block[ 2], 12);
231
232 /* round 5 */
233 JJ(bb, cc, dd, ee, aa, block[ 4], 9);
234 JJ(aa, bb, cc, dd, ee, block[ 0], 15);
235 JJ(ee, aa, bb, cc, dd, block[ 5], 5);
236 JJ(dd, ee, aa, bb, cc, block[ 9], 11);
237 JJ(cc, dd, ee, aa, bb, block[ 7], 6);
238 JJ(bb, cc, dd, ee, aa, block[12], 8);
239 JJ(aa, bb, cc, dd, ee, block[ 2], 13);
240 JJ(ee, aa, bb, cc, dd, block[10], 12);
241 JJ(dd, ee, aa, bb, cc, block[14], 5);
242 JJ(cc, dd, ee, aa, bb, block[ 1], 12);
243 JJ(bb, cc, dd, ee, aa, block[ 3], 13);
244 JJ(aa, bb, cc, dd, ee, block[ 8], 14);
245 JJ(ee, aa, bb, cc, dd, block[11], 11);
246 JJ(dd, ee, aa, bb, cc, block[ 6], 8);
247 JJ(cc, dd, ee, aa, bb, block[15], 5);
248 JJ(bb, cc, dd, ee, aa, block[13], 6);
249
250 /* parallel round 1 */
251 JJJ(aaa, bbb, ccc, ddd, eee, block[ 5], 8);
252 JJJ(eee, aaa, bbb, ccc, ddd, block[14], 9);
253 JJJ(ddd, eee, aaa, bbb, ccc, block[ 7], 9);
254 JJJ(ccc, ddd, eee, aaa, bbb, block[ 0], 11);
255 JJJ(bbb, ccc, ddd, eee, aaa, block[ 9], 13);
256 JJJ(aaa, bbb, ccc, ddd, eee, block[ 2], 15);
257 JJJ(eee, aaa, bbb, ccc, ddd, block[11], 15);
258 JJJ(ddd, eee, aaa, bbb, ccc, block[ 4], 5);
259 JJJ(ccc, ddd, eee, aaa, bbb, block[13], 7);
260 JJJ(bbb, ccc, ddd, eee, aaa, block[ 6], 7);
261 JJJ(aaa, bbb, ccc, ddd, eee, block[15], 8);
262 JJJ(eee, aaa, bbb, ccc, ddd, block[ 8], 11);
263 JJJ(ddd, eee, aaa, bbb, ccc, block[ 1], 14);
264 JJJ(ccc, ddd, eee, aaa, bbb, block[10], 14);
265 JJJ(bbb, ccc, ddd, eee, aaa, block[ 3], 12);
266 JJJ(aaa, bbb, ccc, ddd, eee, block[12], 6);
267
268 /* parallel round 2 */
269 III(eee, aaa, bbb, ccc, ddd, block[ 6], 9);
270 III(ddd, eee, aaa, bbb, ccc, block[11], 13);
271 III(ccc, ddd, eee, aaa, bbb, block[ 3], 15);
272 III(bbb, ccc, ddd, eee, aaa, block[ 7], 7);
273 III(aaa, bbb, ccc, ddd, eee, block[ 0], 12);
274 III(eee, aaa, bbb, ccc, ddd, block[13], 8);
275 III(ddd, eee, aaa, bbb, ccc, block[ 5], 9);
276 III(ccc, ddd, eee, aaa, bbb, block[10], 11);
277 III(bbb, ccc, ddd, eee, aaa, block[14], 7);
278 III(aaa, bbb, ccc, ddd, eee, block[15], 7);
279 III(eee, aaa, bbb, ccc, ddd, block[ 8], 12);
280 III(ddd, eee, aaa, bbb, ccc, block[12], 7);
281 III(ccc, ddd, eee, aaa, bbb, block[ 4], 6);
282 III(bbb, ccc, ddd, eee, aaa, block[ 9], 15);
283 III(aaa, bbb, ccc, ddd, eee, block[ 1], 13);
284 III(eee, aaa, bbb, ccc, ddd, block[ 2], 11);
285
286 /* parallel round 3 */
287 HHH(ddd, eee, aaa, bbb, ccc, block[15], 9);
288 HHH(ccc, ddd, eee, aaa, bbb, block[ 5], 7);
289 HHH(bbb, ccc, ddd, eee, aaa, block[ 1], 15);
290 HHH(aaa, bbb, ccc, ddd, eee, block[ 3], 11);
291 HHH(eee, aaa, bbb, ccc, ddd, block[ 7], 8);
292 HHH(ddd, eee, aaa, bbb, ccc, block[14], 6);
293 HHH(ccc, ddd, eee, aaa, bbb, block[ 6], 6);
294 HHH(bbb, ccc, ddd, eee, aaa, block[ 9], 14);
295 HHH(aaa, bbb, ccc, ddd, eee, block[11], 12);
296 HHH(eee, aaa, bbb, ccc, ddd, block[ 8], 13);
297 HHH(ddd, eee, aaa, bbb, ccc, block[12], 5);
298 HHH(ccc, ddd, eee, aaa, bbb, block[ 2], 14);
299 HHH(bbb, ccc, ddd, eee, aaa, block[10], 13);
300 HHH(aaa, bbb, ccc, ddd, eee, block[ 0], 13);
301 HHH(eee, aaa, bbb, ccc, ddd, block[ 4], 7);
302 HHH(ddd, eee, aaa, bbb, ccc, block[13], 5);
303
304 /* parallel round 4 */
305 GGG(ccc, ddd, eee, aaa, bbb, block[ 8], 15);
306 GGG(bbb, ccc, ddd, eee, aaa, block[ 6], 5);
307 GGG(aaa, bbb, ccc, ddd, eee, block[ 4], 8);
308 GGG(eee, aaa, bbb, ccc, ddd, block[ 1], 11);
309 GGG(ddd, eee, aaa, bbb, ccc, block[ 3], 14);
310 GGG(ccc, ddd, eee, aaa, bbb, block[11], 14);
311 GGG(bbb, ccc, ddd, eee, aaa, block[15], 6);
312 GGG(aaa, bbb, ccc, ddd, eee, block[ 0], 14);
313 GGG(eee, aaa, bbb, ccc, ddd, block[ 5], 6);
314 GGG(ddd, eee, aaa, bbb, ccc, block[12], 9);
315 GGG(ccc, ddd, eee, aaa, bbb, block[ 2], 12);
316 GGG(bbb, ccc, ddd, eee, aaa, block[13], 9);
317 GGG(aaa, bbb, ccc, ddd, eee, block[ 9], 12);
318 GGG(eee, aaa, bbb, ccc, ddd, block[ 7], 5);
319 GGG(ddd, eee, aaa, bbb, ccc, block[10], 15);
320 GGG(ccc, ddd, eee, aaa, bbb, block[14], 8);
321
322 /* parallel round 5 */
323 FFF(bbb, ccc, ddd, eee, aaa, block[12] , 8);
324 FFF(aaa, bbb, ccc, ddd, eee, block[15] , 5);
325 FFF(eee, aaa, bbb, ccc, ddd, block[10] , 12);
326 FFF(ddd, eee, aaa, bbb, ccc, block[ 4] , 9);
327 FFF(ccc, ddd, eee, aaa, bbb, block[ 1] , 12);
328 FFF(bbb, ccc, ddd, eee, aaa, block[ 5] , 5);
329 FFF(aaa, bbb, ccc, ddd, eee, block[ 8] , 14);
330 FFF(eee, aaa, bbb, ccc, ddd, block[ 7] , 6);
331 FFF(ddd, eee, aaa, bbb, ccc, block[ 6] , 8);
332 FFF(ccc, ddd, eee, aaa, bbb, block[ 2] , 13);
333 FFF(bbb, ccc, ddd, eee, aaa, block[13] , 6);
334 FFF(aaa, bbb, ccc, ddd, eee, block[14] , 5);
335 FFF(eee, aaa, bbb, ccc, ddd, block[ 0] , 15);
336 FFF(ddd, eee, aaa, bbb, ccc, block[ 3] , 13);
337 FFF(ccc, ddd, eee, aaa, bbb, block[ 9] , 11);
338 FFF(bbb, ccc, ddd, eee, aaa, block[11] , 11);
339
340 /* combine results */
341 ddd += cc + state[1]; /* final result for state[0] */
342 state[1] = state[2] + dd + eee;
343 state[2] = state[3] + ee + aaa;
344 state[3] = state[4] + aa + bbb;
345 state[4] = state[0] + bb + ccc;
346 state[0] = ddd;
347 }
348
349 /********************************************************************/
350
351 void
352 RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes)
353 {
354 uint32_t X[16];
355 uint32_t ofs = 0;
356 uint32_t i;
357 #ifdef WORDS_BIGENDIAN
358 uint32_t j;
359 #endif
360
361 _DIAGASSERT(context != NULL);
362 _DIAGASSERT(data != NULL);
363
364 /* update length[] */
365 #if SIZEOF_SIZE_T * CHAR_BIT > 32
366 context->length[1] += (uint32_t)((context->length[0] + nbytes) >> 32);
367 #else
368 if (context->length[0] + nbytes < context->length[0])
369 context->length[1]++; /* overflow to msb of length */
370 #endif
371 context->length[0] += (uint32_t)nbytes;
372
373 (void)memset(X, 0, sizeof(X));
374
375 if ( context->buflen + nbytes < 64 )
376 {
377 (void)memcpy(context->bbuffer + context->buflen, data, nbytes);
378 context->buflen += (uint32_t)nbytes;
379 }
380 else
381 {
382 /* process first block */
383 ofs = 64 - context->buflen;
384 (void)memcpy(context->bbuffer + context->buflen, data, ofs);
385 #ifndef WORDS_BIGENDIAN
386 (void)memcpy(X, context->bbuffer, sizeof(X));
387 #else
388 for (j=0; j < 16; j++)
389 X[j] = BYTES_TO_DWORD(context->bbuffer + (4 * j));
390 #endif
391 RMD160_Transform(context->state, X);
392 nbytes -= ofs;
393
394 /* process remaining complete blocks */
395 for (i = 0; i < (nbytes >> 6); i++) {
396 #ifndef WORDS_BIGENDIAN
397 (void)memcpy(X, data + (64 * i) + ofs, sizeof(X));
398 #else
399 for (j=0; j < 16; j++)
400 X[j] = BYTES_TO_DWORD(data + (64 * i) + (4 * j) + ofs);
401 #endif
402 RMD160_Transform(context->state, X);
403 }
404
405 /*
406 * Put last bytes from data into context's buffer
407 */
408 context->buflen = (uint32_t)nbytes & 63;
409 memcpy(context->bbuffer, data + (64 * i) + ofs, context->buflen);
410 }
411 }
412
413 /********************************************************************/
414
415 void
416 RMD160_Finish(RMD160_CTX *context, uint8_t digest[20])
417 {
418 uint32_t i;
419 uint32_t X[16];
420 #ifdef WORDS_BIGENDIAN
421 uint32_t j;
422 #endif
423
424 _DIAGASSERT(digest != NULL);
425 _DIAGASSERT(context != NULL);
426
427 /* append the bit m_n == 1 */
428 context->bbuffer[context->buflen] = (uint8_t)'\200';
429
430 (void)memset(context->bbuffer + context->buflen + 1, 0,
431 63 - context->buflen);
432 #ifndef WORDS_BIGENDIAN
433 (void)memcpy(X, context->bbuffer, sizeof(X));
434 #else
435 for (j=0; j < 16; j++)
436 X[j] = BYTES_TO_DWORD(context->bbuffer + (4 * j));
437 #endif
438 if ((context->buflen) > 55) {
439 /* length goes to next block */
440 RMD160_Transform(context->state, X);
441 (void)memset(X, 0, sizeof(X));
442 }
443
444 /* append length in bits */
445 X[14] = context->length[0] << 3;
446 X[15] = (context->length[0] >> 29) |
447 (context->length[1] << 3);
448 RMD160_Transform(context->state, X);
449
450 if (digest != NULL) {
451 for (i = 0; i < 20; i += 4) {
452 /* extracts the 8 least significant bits. */
453 digest[i] = context->state[i>>2];
454 digest[i + 1] = (context->state[i>>2] >> 8);
455 digest[i + 2] = (context->state[i>>2] >> 16);
456 digest[i + 3] = (context->state[i>>2] >> 24);
457 }
458 }
459 }
460
461 /************************ end of file rmd160.c **********************/
data
VALUE data
Definition: tcltklib.c:3368
rmd160.h
block
int register char * block
Definition: crypt.c:949
RMD160_CTX::length
uint32_t length[2]
Definition: rmd160.h:33
i
ssize_t i
Definition: bigdecimal.c:5655
RMD160_CTX::buflen
uint32_t buflen
Definition: rmd160.h:35
II
#define II(a, b, c, d, e, x, s)
Definition: rmd160.c:89
state
int state
Definition: tcltklib.c:1462
uint8_t
unsigned char uint8_t
Definition: sha2.h:100
memset
memset(y->frac+ix+1, 0,(y->Prec-(ix+1))*sizeof(BDIGIT))
JJJ
#define JJJ(a, b, c, d, e, x, s)
Definition: rmd160.c:119
RMD160_Finish
void RMD160_Finish(RMD160_CTX *context, uint8_t digest[20])
Definition: rmd160.c:416
GGG
#define GGG(a, b, c, d, e, x, s)
Definition: rmd160.c:104
GG
#define GG(a, b, c, d, e, x, s)
Definition: rmd160.c:79
III
#define III(a, b, c, d, e, x, s)
Definition: rmd160.c:114
BYTES_TO_DWORD
#define BYTES_TO_DWORD(strptr)
Definition: rmd160.c:56
U
Definition: util.c:789
RMD160_Transform
void RMD160_Transform(uint32_t state[5], const uint32_t block[16])
Definition: rmd160.c:146
FF
#define FF(a, b, c, d, e, x, s)
Definition: rmd160.c:74
memcpy
memcpy(buf+1, str, len)
void
VP_EXPORT void
Definition: bigdecimal.c:5083
length
size_t length
Definition: tcltklib.c:4559
RMD160_Update
void RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes)
Definition: rmd160.c:352
uint32_t
unsigned int uint32_t
Definition: sha2.h:101
RMD160_Init
void RMD160_Init(RMD160_CTX *context)
Definition: rmd160.c:128
_DIAGASSERT
#define _DIAGASSERT(cond)
Definition: rmd160.c:47
RMD160_CTX
Definition: rmd160.h:31
HH
#define HH(a, b, c, d, e, x, s)
Definition: rmd160.c:84
JJ
#define JJ(a, b, c, d, e, x, s)
Definition: rmd160.c:94
FFF
#define FFF(a, b, c, d, e, x, s)
Definition: rmd160.c:99
NULL
#define NULL
Definition: _sdbm.c:103
HHH
#define HHH(a, b, c, d, e, x, s)
Definition: rmd160.c:109
RMD160_CTX::state
uint32_t state[5]
Definition: rmd160.h:32
RMD160_CTX::bbuffer
uint8_t bbuffer[64]
Definition: rmd160.h:34