Ruby  2.5.0dev(2017-10-22revision60238)
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$ */
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 int
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  return 1;
142 }
143 
144 /********************************************************************/
145 
146 void
147 RMD160_Transform(uint32_t state[5], const uint32_t block[16])
148 {
149  uint32_t aa, bb, cc, dd, ee;
150  uint32_t aaa, bbb, ccc, ddd, eee;
151 
152  _DIAGASSERT(state != NULL);
153  _DIAGASSERT(block != NULL);
154 
155  aa = aaa = state[0];
156  bb = bbb = state[1];
157  cc = ccc = state[2];
158  dd = ddd = state[3];
159  ee = eee = state[4];
160 
161  /* round 1 */
162  FF(aa, bb, cc, dd, ee, block[ 0], 11);
163  FF(ee, aa, bb, cc, dd, block[ 1], 14);
164  FF(dd, ee, aa, bb, cc, block[ 2], 15);
165  FF(cc, dd, ee, aa, bb, block[ 3], 12);
166  FF(bb, cc, dd, ee, aa, block[ 4], 5);
167  FF(aa, bb, cc, dd, ee, block[ 5], 8);
168  FF(ee, aa, bb, cc, dd, block[ 6], 7);
169  FF(dd, ee, aa, bb, cc, block[ 7], 9);
170  FF(cc, dd, ee, aa, bb, block[ 8], 11);
171  FF(bb, cc, dd, ee, aa, block[ 9], 13);
172  FF(aa, bb, cc, dd, ee, block[10], 14);
173  FF(ee, aa, bb, cc, dd, block[11], 15);
174  FF(dd, ee, aa, bb, cc, block[12], 6);
175  FF(cc, dd, ee, aa, bb, block[13], 7);
176  FF(bb, cc, dd, ee, aa, block[14], 9);
177  FF(aa, bb, cc, dd, ee, block[15], 8);
178 
179  /* round 2 */
180  GG(ee, aa, bb, cc, dd, block[ 7], 7);
181  GG(dd, ee, aa, bb, cc, block[ 4], 6);
182  GG(cc, dd, ee, aa, bb, block[13], 8);
183  GG(bb, cc, dd, ee, aa, block[ 1], 13);
184  GG(aa, bb, cc, dd, ee, block[10], 11);
185  GG(ee, aa, bb, cc, dd, block[ 6], 9);
186  GG(dd, ee, aa, bb, cc, block[15], 7);
187  GG(cc, dd, ee, aa, bb, block[ 3], 15);
188  GG(bb, cc, dd, ee, aa, block[12], 7);
189  GG(aa, bb, cc, dd, ee, block[ 0], 12);
190  GG(ee, aa, bb, cc, dd, block[ 9], 15);
191  GG(dd, ee, aa, bb, cc, block[ 5], 9);
192  GG(cc, dd, ee, aa, bb, block[ 2], 11);
193  GG(bb, cc, dd, ee, aa, block[14], 7);
194  GG(aa, bb, cc, dd, ee, block[11], 13);
195  GG(ee, aa, bb, cc, dd, block[ 8], 12);
196 
197  /* round 3 */
198  HH(dd, ee, aa, bb, cc, block[ 3], 11);
199  HH(cc, dd, ee, aa, bb, block[10], 13);
200  HH(bb, cc, dd, ee, aa, block[14], 6);
201  HH(aa, bb, cc, dd, ee, block[ 4], 7);
202  HH(ee, aa, bb, cc, dd, block[ 9], 14);
203  HH(dd, ee, aa, bb, cc, block[15], 9);
204  HH(cc, dd, ee, aa, bb, block[ 8], 13);
205  HH(bb, cc, dd, ee, aa, block[ 1], 15);
206  HH(aa, bb, cc, dd, ee, block[ 2], 14);
207  HH(ee, aa, bb, cc, dd, block[ 7], 8);
208  HH(dd, ee, aa, bb, cc, block[ 0], 13);
209  HH(cc, dd, ee, aa, bb, block[ 6], 6);
210  HH(bb, cc, dd, ee, aa, block[13], 5);
211  HH(aa, bb, cc, dd, ee, block[11], 12);
212  HH(ee, aa, bb, cc, dd, block[ 5], 7);
213  HH(dd, ee, aa, bb, cc, block[12], 5);
214 
215  /* round 4 */
216  II(cc, dd, ee, aa, bb, block[ 1], 11);
217  II(bb, cc, dd, ee, aa, block[ 9], 12);
218  II(aa, bb, cc, dd, ee, block[11], 14);
219  II(ee, aa, bb, cc, dd, block[10], 15);
220  II(dd, ee, aa, bb, cc, block[ 0], 14);
221  II(cc, dd, ee, aa, bb, block[ 8], 15);
222  II(bb, cc, dd, ee, aa, block[12], 9);
223  II(aa, bb, cc, dd, ee, block[ 4], 8);
224  II(ee, aa, bb, cc, dd, block[13], 9);
225  II(dd, ee, aa, bb, cc, block[ 3], 14);
226  II(cc, dd, ee, aa, bb, block[ 7], 5);
227  II(bb, cc, dd, ee, aa, block[15], 6);
228  II(aa, bb, cc, dd, ee, block[14], 8);
229  II(ee, aa, bb, cc, dd, block[ 5], 6);
230  II(dd, ee, aa, bb, cc, block[ 6], 5);
231  II(cc, dd, ee, aa, bb, block[ 2], 12);
232 
233  /* round 5 */
234  JJ(bb, cc, dd, ee, aa, block[ 4], 9);
235  JJ(aa, bb, cc, dd, ee, block[ 0], 15);
236  JJ(ee, aa, bb, cc, dd, block[ 5], 5);
237  JJ(dd, ee, aa, bb, cc, block[ 9], 11);
238  JJ(cc, dd, ee, aa, bb, block[ 7], 6);
239  JJ(bb, cc, dd, ee, aa, block[12], 8);
240  JJ(aa, bb, cc, dd, ee, block[ 2], 13);
241  JJ(ee, aa, bb, cc, dd, block[10], 12);
242  JJ(dd, ee, aa, bb, cc, block[14], 5);
243  JJ(cc, dd, ee, aa, bb, block[ 1], 12);
244  JJ(bb, cc, dd, ee, aa, block[ 3], 13);
245  JJ(aa, bb, cc, dd, ee, block[ 8], 14);
246  JJ(ee, aa, bb, cc, dd, block[11], 11);
247  JJ(dd, ee, aa, bb, cc, block[ 6], 8);
248  JJ(cc, dd, ee, aa, bb, block[15], 5);
249  JJ(bb, cc, dd, ee, aa, block[13], 6);
250 
251  /* parallel round 1 */
252  JJJ(aaa, bbb, ccc, ddd, eee, block[ 5], 8);
253  JJJ(eee, aaa, bbb, ccc, ddd, block[14], 9);
254  JJJ(ddd, eee, aaa, bbb, ccc, block[ 7], 9);
255  JJJ(ccc, ddd, eee, aaa, bbb, block[ 0], 11);
256  JJJ(bbb, ccc, ddd, eee, aaa, block[ 9], 13);
257  JJJ(aaa, bbb, ccc, ddd, eee, block[ 2], 15);
258  JJJ(eee, aaa, bbb, ccc, ddd, block[11], 15);
259  JJJ(ddd, eee, aaa, bbb, ccc, block[ 4], 5);
260  JJJ(ccc, ddd, eee, aaa, bbb, block[13], 7);
261  JJJ(bbb, ccc, ddd, eee, aaa, block[ 6], 7);
262  JJJ(aaa, bbb, ccc, ddd, eee, block[15], 8);
263  JJJ(eee, aaa, bbb, ccc, ddd, block[ 8], 11);
264  JJJ(ddd, eee, aaa, bbb, ccc, block[ 1], 14);
265  JJJ(ccc, ddd, eee, aaa, bbb, block[10], 14);
266  JJJ(bbb, ccc, ddd, eee, aaa, block[ 3], 12);
267  JJJ(aaa, bbb, ccc, ddd, eee, block[12], 6);
268 
269  /* parallel round 2 */
270  III(eee, aaa, bbb, ccc, ddd, block[ 6], 9);
271  III(ddd, eee, aaa, bbb, ccc, block[11], 13);
272  III(ccc, ddd, eee, aaa, bbb, block[ 3], 15);
273  III(bbb, ccc, ddd, eee, aaa, block[ 7], 7);
274  III(aaa, bbb, ccc, ddd, eee, block[ 0], 12);
275  III(eee, aaa, bbb, ccc, ddd, block[13], 8);
276  III(ddd, eee, aaa, bbb, ccc, block[ 5], 9);
277  III(ccc, ddd, eee, aaa, bbb, block[10], 11);
278  III(bbb, ccc, ddd, eee, aaa, block[14], 7);
279  III(aaa, bbb, ccc, ddd, eee, block[15], 7);
280  III(eee, aaa, bbb, ccc, ddd, block[ 8], 12);
281  III(ddd, eee, aaa, bbb, ccc, block[12], 7);
282  III(ccc, ddd, eee, aaa, bbb, block[ 4], 6);
283  III(bbb, ccc, ddd, eee, aaa, block[ 9], 15);
284  III(aaa, bbb, ccc, ddd, eee, block[ 1], 13);
285  III(eee, aaa, bbb, ccc, ddd, block[ 2], 11);
286 
287  /* parallel round 3 */
288  HHH(ddd, eee, aaa, bbb, ccc, block[15], 9);
289  HHH(ccc, ddd, eee, aaa, bbb, block[ 5], 7);
290  HHH(bbb, ccc, ddd, eee, aaa, block[ 1], 15);
291  HHH(aaa, bbb, ccc, ddd, eee, block[ 3], 11);
292  HHH(eee, aaa, bbb, ccc, ddd, block[ 7], 8);
293  HHH(ddd, eee, aaa, bbb, ccc, block[14], 6);
294  HHH(ccc, ddd, eee, aaa, bbb, block[ 6], 6);
295  HHH(bbb, ccc, ddd, eee, aaa, block[ 9], 14);
296  HHH(aaa, bbb, ccc, ddd, eee, block[11], 12);
297  HHH(eee, aaa, bbb, ccc, ddd, block[ 8], 13);
298  HHH(ddd, eee, aaa, bbb, ccc, block[12], 5);
299  HHH(ccc, ddd, eee, aaa, bbb, block[ 2], 14);
300  HHH(bbb, ccc, ddd, eee, aaa, block[10], 13);
301  HHH(aaa, bbb, ccc, ddd, eee, block[ 0], 13);
302  HHH(eee, aaa, bbb, ccc, ddd, block[ 4], 7);
303  HHH(ddd, eee, aaa, bbb, ccc, block[13], 5);
304 
305  /* parallel round 4 */
306  GGG(ccc, ddd, eee, aaa, bbb, block[ 8], 15);
307  GGG(bbb, ccc, ddd, eee, aaa, block[ 6], 5);
308  GGG(aaa, bbb, ccc, ddd, eee, block[ 4], 8);
309  GGG(eee, aaa, bbb, ccc, ddd, block[ 1], 11);
310  GGG(ddd, eee, aaa, bbb, ccc, block[ 3], 14);
311  GGG(ccc, ddd, eee, aaa, bbb, block[11], 14);
312  GGG(bbb, ccc, ddd, eee, aaa, block[15], 6);
313  GGG(aaa, bbb, ccc, ddd, eee, block[ 0], 14);
314  GGG(eee, aaa, bbb, ccc, ddd, block[ 5], 6);
315  GGG(ddd, eee, aaa, bbb, ccc, block[12], 9);
316  GGG(ccc, ddd, eee, aaa, bbb, block[ 2], 12);
317  GGG(bbb, ccc, ddd, eee, aaa, block[13], 9);
318  GGG(aaa, bbb, ccc, ddd, eee, block[ 9], 12);
319  GGG(eee, aaa, bbb, ccc, ddd, block[ 7], 5);
320  GGG(ddd, eee, aaa, bbb, ccc, block[10], 15);
321  GGG(ccc, ddd, eee, aaa, bbb, block[14], 8);
322 
323  /* parallel round 5 */
324  FFF(bbb, ccc, ddd, eee, aaa, block[12] , 8);
325  FFF(aaa, bbb, ccc, ddd, eee, block[15] , 5);
326  FFF(eee, aaa, bbb, ccc, ddd, block[10] , 12);
327  FFF(ddd, eee, aaa, bbb, ccc, block[ 4] , 9);
328  FFF(ccc, ddd, eee, aaa, bbb, block[ 1] , 12);
329  FFF(bbb, ccc, ddd, eee, aaa, block[ 5] , 5);
330  FFF(aaa, bbb, ccc, ddd, eee, block[ 8] , 14);
331  FFF(eee, aaa, bbb, ccc, ddd, block[ 7] , 6);
332  FFF(ddd, eee, aaa, bbb, ccc, block[ 6] , 8);
333  FFF(ccc, ddd, eee, aaa, bbb, block[ 2] , 13);
334  FFF(bbb, ccc, ddd, eee, aaa, block[13] , 6);
335  FFF(aaa, bbb, ccc, ddd, eee, block[14] , 5);
336  FFF(eee, aaa, bbb, ccc, ddd, block[ 0] , 15);
337  FFF(ddd, eee, aaa, bbb, ccc, block[ 3] , 13);
338  FFF(ccc, ddd, eee, aaa, bbb, block[ 9] , 11);
339  FFF(bbb, ccc, ddd, eee, aaa, block[11] , 11);
340 
341  /* combine results */
342  ddd += cc + state[1]; /* final result for state[0] */
343  state[1] = state[2] + dd + eee;
344  state[2] = state[3] + ee + aaa;
345  state[3] = state[4] + aa + bbb;
346  state[4] = state[0] + bb + ccc;
347  state[0] = ddd;
348 }
349 
350 /********************************************************************/
351 
352 void
353 RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes)
354 {
355  uint32_t X[16];
356  uint32_t ofs = 0;
357  uint32_t i;
358 #ifdef WORDS_BIGENDIAN
359  uint32_t j;
360 #endif
361 
362  _DIAGASSERT(context != NULL);
363  _DIAGASSERT(data != NULL);
364 
365  /* update length[] */
366 #if SIZEOF_SIZE_T * CHAR_BIT > 32
367  context->length[1] += (uint32_t)((context->length[0] + nbytes) >> 32);
368 #else
369  if (context->length[0] + nbytes < context->length[0])
370  context->length[1]++; /* overflow to msb of length */
371 #endif
372  context->length[0] += (uint32_t)nbytes;
373 
374  (void)memset(X, 0, sizeof(X));
375 
376  if ( context->buflen + nbytes < 64 )
377  {
378  (void)memcpy(context->bbuffer + context->buflen, data, nbytes);
379  context->buflen += (uint32_t)nbytes;
380  }
381  else
382  {
383  /* process first block */
384  ofs = 64 - context->buflen;
385  (void)memcpy(context->bbuffer + context->buflen, data, ofs);
386 #ifndef WORDS_BIGENDIAN
387  (void)memcpy(X, context->bbuffer, sizeof(X));
388 #else
389  for (j=0; j < 16; j++)
390  X[j] = BYTES_TO_DWORD(context->bbuffer + (4 * j));
391 #endif
392  RMD160_Transform(context->state, X);
393  nbytes -= ofs;
394 
395  /* process remaining complete blocks */
396  for (i = 0; i < (nbytes >> 6); i++) {
397 #ifndef WORDS_BIGENDIAN
398  (void)memcpy(X, data + (64 * i) + ofs, sizeof(X));
399 #else
400  for (j=0; j < 16; j++)
401  X[j] = BYTES_TO_DWORD(data + (64 * i) + (4 * j) + ofs);
402 #endif
403  RMD160_Transform(context->state, X);
404  }
405 
406  /*
407  * Put last bytes from data into context's buffer
408  */
409  context->buflen = (uint32_t)nbytes & 63;
410  memcpy(context->bbuffer, data + (64 * i) + ofs, context->buflen);
411  }
412 }
413 
414 /********************************************************************/
415 
416 int
417 RMD160_Finish(RMD160_CTX *context, uint8_t digest[20])
418 {
419  uint32_t i;
420  uint32_t X[16];
421 #ifdef WORDS_BIGENDIAN
422  uint32_t j;
423 #endif
424 
425  _DIAGASSERT(digest != NULL);
426  _DIAGASSERT(context != NULL);
427 
428  /* append the bit m_n == 1 */
429  context->bbuffer[context->buflen] = (uint8_t)'\200';
430 
431  (void)memset(context->bbuffer + context->buflen + 1, 0,
432  63 - context->buflen);
433 #ifndef WORDS_BIGENDIAN
434  (void)memcpy(X, context->bbuffer, sizeof(X));
435 #else
436  for (j=0; j < 16; j++)
437  X[j] = BYTES_TO_DWORD(context->bbuffer + (4 * j));
438 #endif
439  if ((context->buflen) > 55) {
440  /* length goes to next block */
441  RMD160_Transform(context->state, X);
442  (void)memset(X, 0, sizeof(X));
443  }
444 
445  /* append length in bits */
446  X[14] = context->length[0] << 3;
447  X[15] = (context->length[0] >> 29) |
448  (context->length[1] << 3);
449  RMD160_Transform(context->state, X);
450 
451  if (digest != NULL) {
452  for (i = 0; i < 20; i += 4) {
453  /* extracts the 8 least significant bits. */
454  digest[i] = context->state[i>>2];
455  digest[i + 1] = (context->state[i>>2] >> 8);
456  digest[i + 2] = (context->state[i>>2] >> 16);
457  digest[i + 3] = (context->state[i>>2] >> 24);
458  }
459  }
460  return 1;
461 }
462 
463 /************************ end of file rmd160.c **********************/
uint32_t length[2]
Definition: rmd160.h:33
uint32_t buflen
Definition: rmd160.h:35
#define II(a, b, c, d, e, x, s)
Definition: rmd160.c:89
unsigned char uint8_t
Definition: sha2.h:100
#define JJJ(a, b, c, d, e, x, s)
Definition: rmd160.c:119
#define GGG(a, b, c, d, e, x, s)
Definition: rmd160.c:104
#define GG(a, b, c, d, e, x, s)
Definition: rmd160.c:79
#define III(a, b, c, d, e, x, s)
Definition: rmd160.c:114
#define BYTES_TO_DWORD(strptr)
Definition: rmd160.c:56
Definition: util.c:841
void RMD160_Transform(uint32_t state[5], const uint32_t block[16])
Definition: rmd160.c:147
#define FF(a, b, c, d, e, x, s)
Definition: rmd160.c:74
void RMD160_Update(RMD160_CTX *context, const uint8_t *data, size_t nbytes)
Definition: rmd160.c:353
unsigned int uint32_t
Definition: sha2.h:101
int RMD160_Finish(RMD160_CTX *context, uint8_t digest[20])
Definition: rmd160.c:417
#define _DIAGASSERT(cond)
Definition: rmd160.c:47
#define HH(a, b, c, d, e, x, s)
Definition: rmd160.c:84
#define JJ(a, b, c, d, e, x, s)
Definition: rmd160.c:94
#define FFF(a, b, c, d, e, x, s)
Definition: rmd160.c:99
#define NULL
Definition: _sdbm.c:102
#define HHH(a, b, c, d, e, x, s)
Definition: rmd160.c:109
uint32_t state[5]
Definition: rmd160.h:32
int RMD160_Init(RMD160_CTX *context)
Definition: rmd160.c:128
uint8_t bbuffer[64]
Definition: rmd160.h:34