Mercurial > dropbear
annotate rmd160.c @ 0:d7da3b1e1540 libtomcrypt
put back the 0.95 makefile which was inadvertently merged over
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 31 May 2004 18:21:40 +0000 |
parents | |
children | 6362d3854bb4 |
rev | line source |
---|---|
0
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
2 * |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
3 * LibTomCrypt is a library that provides various cryptographic |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
4 * algorithms in a highly modular and flexible manner. |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
5 * |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
6 * The library is free for all purposes without any express |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
7 * guarantee it works. |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
8 * |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
9 * Tom St Denis, [email protected], http://libtomcrypt.org |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
10 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
11 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
12 /* Implementation of RIPEMD-160 based on the source by Antoon Bosselaers, ESAT-COSIC |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
13 * |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
14 * This source has been radically overhauled to be portable and work within |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
15 * the LibTomCrypt API by Tom St Denis |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
16 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
17 #include "mycrypt.h" |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
18 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
19 #ifdef RIPEMD160 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
20 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
21 const struct _hash_descriptor rmd160_desc = |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
22 { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
23 "rmd160", |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
24 9, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
25 20, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
26 64, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
27 &rmd160_init, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
28 &rmd160_process, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
29 &rmd160_done, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
30 &rmd160_test |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
31 }; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
32 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
33 /* the five basic functions F(), G() and H() */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
34 #define F(x, y, z) ((x) ^ (y) ^ (z)) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
35 #define G(x, y, z) (((x) & (y)) | (~(x) & (z))) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
36 #define H(x, y, z) (((x) | ~(y)) ^ (z)) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
37 #define I(x, y, z) (((x) & (z)) | ((y) & ~(z))) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
38 #define J(x, y, z) ((x) ^ ((y) | ~(z))) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
39 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
40 /* the ten basic operations FF() through III() */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
41 #define FF(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
42 (a) += F((b), (c), (d)) + (x);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
43 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
44 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
45 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
46 #define GG(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
47 (a) += G((b), (c), (d)) + (x) + 0x5a827999UL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
48 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
49 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
50 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
51 #define HH(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
52 (a) += H((b), (c), (d)) + (x) + 0x6ed9eba1UL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
53 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
54 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
55 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
56 #define II(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
57 (a) += I((b), (c), (d)) + (x) + 0x8f1bbcdcUL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
58 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
59 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
60 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
61 #define JJ(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
62 (a) += J((b), (c), (d)) + (x) + 0xa953fd4eUL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
63 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
64 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
65 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
66 #define FFF(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
67 (a) += F((b), (c), (d)) + (x);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
68 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
69 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
70 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
71 #define GGG(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
72 (a) += G((b), (c), (d)) + (x) + 0x7a6d76e9UL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
73 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
74 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
75 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
76 #define HHH(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
77 (a) += H((b), (c), (d)) + (x) + 0x6d703ef3UL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
78 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
79 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
80 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
81 #define III(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
82 (a) += I((b), (c), (d)) + (x) + 0x5c4dd124UL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
83 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
84 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
85 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
86 #define JJJ(a, b, c, d, e, x, s) \ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
87 (a) += J((b), (c), (d)) + (x) + 0x50a28be6UL;\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
88 (a) = ROL((a), (s)) + (e);\ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
89 (c) = ROL((c), 10); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
90 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
91 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
92 #ifdef CLEAN_STACK |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
93 static void _rmd160_compress(hash_state *md, unsigned char *buf) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
94 #else |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
95 static void rmd160_compress(hash_state *md, unsigned char *buf) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
96 #endif |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
97 { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
98 ulong32 aa,bb,cc,dd,ee,aaa,bbb,ccc,ddd,eee,X[16]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
99 int i; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
100 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
101 /* load words X */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
102 for (i = 0; i < 16; i++){ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
103 LOAD32L(X[i], buf + (4 * i)); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
104 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
105 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
106 /* load state */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
107 aa = aaa = md->rmd160.state[0]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
108 bb = bbb = md->rmd160.state[1]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
109 cc = ccc = md->rmd160.state[2]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
110 dd = ddd = md->rmd160.state[3]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
111 ee = eee = md->rmd160.state[4]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
112 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
113 /* round 1 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
114 FF(aa, bb, cc, dd, ee, X[ 0], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
115 FF(ee, aa, bb, cc, dd, X[ 1], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
116 FF(dd, ee, aa, bb, cc, X[ 2], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
117 FF(cc, dd, ee, aa, bb, X[ 3], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
118 FF(bb, cc, dd, ee, aa, X[ 4], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
119 FF(aa, bb, cc, dd, ee, X[ 5], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
120 FF(ee, aa, bb, cc, dd, X[ 6], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
121 FF(dd, ee, aa, bb, cc, X[ 7], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
122 FF(cc, dd, ee, aa, bb, X[ 8], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
123 FF(bb, cc, dd, ee, aa, X[ 9], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
124 FF(aa, bb, cc, dd, ee, X[10], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
125 FF(ee, aa, bb, cc, dd, X[11], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
126 FF(dd, ee, aa, bb, cc, X[12], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
127 FF(cc, dd, ee, aa, bb, X[13], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
128 FF(bb, cc, dd, ee, aa, X[14], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
129 FF(aa, bb, cc, dd, ee, X[15], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
130 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
131 /* round 2 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
132 GG(ee, aa, bb, cc, dd, X[ 7], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
133 GG(dd, ee, aa, bb, cc, X[ 4], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
134 GG(cc, dd, ee, aa, bb, X[13], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
135 GG(bb, cc, dd, ee, aa, X[ 1], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
136 GG(aa, bb, cc, dd, ee, X[10], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
137 GG(ee, aa, bb, cc, dd, X[ 6], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
138 GG(dd, ee, aa, bb, cc, X[15], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
139 GG(cc, dd, ee, aa, bb, X[ 3], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
140 GG(bb, cc, dd, ee, aa, X[12], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
141 GG(aa, bb, cc, dd, ee, X[ 0], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
142 GG(ee, aa, bb, cc, dd, X[ 9], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
143 GG(dd, ee, aa, bb, cc, X[ 5], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
144 GG(cc, dd, ee, aa, bb, X[ 2], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
145 GG(bb, cc, dd, ee, aa, X[14], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
146 GG(aa, bb, cc, dd, ee, X[11], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
147 GG(ee, aa, bb, cc, dd, X[ 8], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
148 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
149 /* round 3 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
150 HH(dd, ee, aa, bb, cc, X[ 3], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
151 HH(cc, dd, ee, aa, bb, X[10], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
152 HH(bb, cc, dd, ee, aa, X[14], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
153 HH(aa, bb, cc, dd, ee, X[ 4], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
154 HH(ee, aa, bb, cc, dd, X[ 9], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
155 HH(dd, ee, aa, bb, cc, X[15], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
156 HH(cc, dd, ee, aa, bb, X[ 8], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
157 HH(bb, cc, dd, ee, aa, X[ 1], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
158 HH(aa, bb, cc, dd, ee, X[ 2], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
159 HH(ee, aa, bb, cc, dd, X[ 7], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
160 HH(dd, ee, aa, bb, cc, X[ 0], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
161 HH(cc, dd, ee, aa, bb, X[ 6], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
162 HH(bb, cc, dd, ee, aa, X[13], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
163 HH(aa, bb, cc, dd, ee, X[11], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
164 HH(ee, aa, bb, cc, dd, X[ 5], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
165 HH(dd, ee, aa, bb, cc, X[12], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
166 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
167 /* round 4 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
168 II(cc, dd, ee, aa, bb, X[ 1], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
169 II(bb, cc, dd, ee, aa, X[ 9], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
170 II(aa, bb, cc, dd, ee, X[11], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
171 II(ee, aa, bb, cc, dd, X[10], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
172 II(dd, ee, aa, bb, cc, X[ 0], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
173 II(cc, dd, ee, aa, bb, X[ 8], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
174 II(bb, cc, dd, ee, aa, X[12], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
175 II(aa, bb, cc, dd, ee, X[ 4], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
176 II(ee, aa, bb, cc, dd, X[13], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
177 II(dd, ee, aa, bb, cc, X[ 3], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
178 II(cc, dd, ee, aa, bb, X[ 7], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
179 II(bb, cc, dd, ee, aa, X[15], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
180 II(aa, bb, cc, dd, ee, X[14], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
181 II(ee, aa, bb, cc, dd, X[ 5], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
182 II(dd, ee, aa, bb, cc, X[ 6], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
183 II(cc, dd, ee, aa, bb, X[ 2], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
184 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
185 /* round 5 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
186 JJ(bb, cc, dd, ee, aa, X[ 4], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
187 JJ(aa, bb, cc, dd, ee, X[ 0], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
188 JJ(ee, aa, bb, cc, dd, X[ 5], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
189 JJ(dd, ee, aa, bb, cc, X[ 9], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
190 JJ(cc, dd, ee, aa, bb, X[ 7], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
191 JJ(bb, cc, dd, ee, aa, X[12], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
192 JJ(aa, bb, cc, dd, ee, X[ 2], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
193 JJ(ee, aa, bb, cc, dd, X[10], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
194 JJ(dd, ee, aa, bb, cc, X[14], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
195 JJ(cc, dd, ee, aa, bb, X[ 1], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
196 JJ(bb, cc, dd, ee, aa, X[ 3], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
197 JJ(aa, bb, cc, dd, ee, X[ 8], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
198 JJ(ee, aa, bb, cc, dd, X[11], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
199 JJ(dd, ee, aa, bb, cc, X[ 6], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
200 JJ(cc, dd, ee, aa, bb, X[15], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
201 JJ(bb, cc, dd, ee, aa, X[13], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
202 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
203 /* parallel round 1 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
204 JJJ(aaa, bbb, ccc, ddd, eee, X[ 5], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
205 JJJ(eee, aaa, bbb, ccc, ddd, X[14], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
206 JJJ(ddd, eee, aaa, bbb, ccc, X[ 7], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
207 JJJ(ccc, ddd, eee, aaa, bbb, X[ 0], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
208 JJJ(bbb, ccc, ddd, eee, aaa, X[ 9], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
209 JJJ(aaa, bbb, ccc, ddd, eee, X[ 2], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
210 JJJ(eee, aaa, bbb, ccc, ddd, X[11], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
211 JJJ(ddd, eee, aaa, bbb, ccc, X[ 4], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
212 JJJ(ccc, ddd, eee, aaa, bbb, X[13], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
213 JJJ(bbb, ccc, ddd, eee, aaa, X[ 6], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
214 JJJ(aaa, bbb, ccc, ddd, eee, X[15], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
215 JJJ(eee, aaa, bbb, ccc, ddd, X[ 8], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
216 JJJ(ddd, eee, aaa, bbb, ccc, X[ 1], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
217 JJJ(ccc, ddd, eee, aaa, bbb, X[10], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
218 JJJ(bbb, ccc, ddd, eee, aaa, X[ 3], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
219 JJJ(aaa, bbb, ccc, ddd, eee, X[12], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
220 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
221 /* parallel round 2 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
222 III(eee, aaa, bbb, ccc, ddd, X[ 6], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
223 III(ddd, eee, aaa, bbb, ccc, X[11], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
224 III(ccc, ddd, eee, aaa, bbb, X[ 3], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
225 III(bbb, ccc, ddd, eee, aaa, X[ 7], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
226 III(aaa, bbb, ccc, ddd, eee, X[ 0], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
227 III(eee, aaa, bbb, ccc, ddd, X[13], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
228 III(ddd, eee, aaa, bbb, ccc, X[ 5], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
229 III(ccc, ddd, eee, aaa, bbb, X[10], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
230 III(bbb, ccc, ddd, eee, aaa, X[14], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
231 III(aaa, bbb, ccc, ddd, eee, X[15], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
232 III(eee, aaa, bbb, ccc, ddd, X[ 8], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
233 III(ddd, eee, aaa, bbb, ccc, X[12], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
234 III(ccc, ddd, eee, aaa, bbb, X[ 4], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
235 III(bbb, ccc, ddd, eee, aaa, X[ 9], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
236 III(aaa, bbb, ccc, ddd, eee, X[ 1], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
237 III(eee, aaa, bbb, ccc, ddd, X[ 2], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
238 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
239 /* parallel round 3 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
240 HHH(ddd, eee, aaa, bbb, ccc, X[15], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
241 HHH(ccc, ddd, eee, aaa, bbb, X[ 5], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
242 HHH(bbb, ccc, ddd, eee, aaa, X[ 1], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
243 HHH(aaa, bbb, ccc, ddd, eee, X[ 3], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
244 HHH(eee, aaa, bbb, ccc, ddd, X[ 7], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
245 HHH(ddd, eee, aaa, bbb, ccc, X[14], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
246 HHH(ccc, ddd, eee, aaa, bbb, X[ 6], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
247 HHH(bbb, ccc, ddd, eee, aaa, X[ 9], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
248 HHH(aaa, bbb, ccc, ddd, eee, X[11], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
249 HHH(eee, aaa, bbb, ccc, ddd, X[ 8], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
250 HHH(ddd, eee, aaa, bbb, ccc, X[12], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
251 HHH(ccc, ddd, eee, aaa, bbb, X[ 2], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
252 HHH(bbb, ccc, ddd, eee, aaa, X[10], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
253 HHH(aaa, bbb, ccc, ddd, eee, X[ 0], 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
254 HHH(eee, aaa, bbb, ccc, ddd, X[ 4], 7); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
255 HHH(ddd, eee, aaa, bbb, ccc, X[13], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
256 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
257 /* parallel round 4 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
258 GGG(ccc, ddd, eee, aaa, bbb, X[ 8], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
259 GGG(bbb, ccc, ddd, eee, aaa, X[ 6], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
260 GGG(aaa, bbb, ccc, ddd, eee, X[ 4], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
261 GGG(eee, aaa, bbb, ccc, ddd, X[ 1], 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
262 GGG(ddd, eee, aaa, bbb, ccc, X[ 3], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
263 GGG(ccc, ddd, eee, aaa, bbb, X[11], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
264 GGG(bbb, ccc, ddd, eee, aaa, X[15], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
265 GGG(aaa, bbb, ccc, ddd, eee, X[ 0], 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
266 GGG(eee, aaa, bbb, ccc, ddd, X[ 5], 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
267 GGG(ddd, eee, aaa, bbb, ccc, X[12], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
268 GGG(ccc, ddd, eee, aaa, bbb, X[ 2], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
269 GGG(bbb, ccc, ddd, eee, aaa, X[13], 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
270 GGG(aaa, bbb, ccc, ddd, eee, X[ 9], 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
271 GGG(eee, aaa, bbb, ccc, ddd, X[ 7], 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
272 GGG(ddd, eee, aaa, bbb, ccc, X[10], 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
273 GGG(ccc, ddd, eee, aaa, bbb, X[14], 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
274 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
275 /* parallel round 5 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
276 FFF(bbb, ccc, ddd, eee, aaa, X[12] , 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
277 FFF(aaa, bbb, ccc, ddd, eee, X[15] , 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
278 FFF(eee, aaa, bbb, ccc, ddd, X[10] , 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
279 FFF(ddd, eee, aaa, bbb, ccc, X[ 4] , 9); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
280 FFF(ccc, ddd, eee, aaa, bbb, X[ 1] , 12); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
281 FFF(bbb, ccc, ddd, eee, aaa, X[ 5] , 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
282 FFF(aaa, bbb, ccc, ddd, eee, X[ 8] , 14); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
283 FFF(eee, aaa, bbb, ccc, ddd, X[ 7] , 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
284 FFF(ddd, eee, aaa, bbb, ccc, X[ 6] , 8); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
285 FFF(ccc, ddd, eee, aaa, bbb, X[ 2] , 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
286 FFF(bbb, ccc, ddd, eee, aaa, X[13] , 6); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
287 FFF(aaa, bbb, ccc, ddd, eee, X[14] , 5); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
288 FFF(eee, aaa, bbb, ccc, ddd, X[ 0] , 15); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
289 FFF(ddd, eee, aaa, bbb, ccc, X[ 3] , 13); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
290 FFF(ccc, ddd, eee, aaa, bbb, X[ 9] , 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
291 FFF(bbb, ccc, ddd, eee, aaa, X[11] , 11); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
292 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
293 /* combine results */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
294 ddd += cc + md->rmd160.state[1]; /* final result for md->rmd160.state[0] */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
295 md->rmd160.state[1] = md->rmd160.state[2] + dd + eee; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
296 md->rmd160.state[2] = md->rmd160.state[3] + ee + aaa; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
297 md->rmd160.state[3] = md->rmd160.state[4] + aa + bbb; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
298 md->rmd160.state[4] = md->rmd160.state[0] + bb + ccc; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
299 md->rmd160.state[0] = ddd; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
300 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
301 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
302 #ifdef CLEAN_STACK |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
303 static void rmd160_compress(hash_state *md, unsigned char *buf) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
304 { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
305 _rmd160_compress(md, buf); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
306 burn_stack(sizeof(ulong32) * 26 + sizeof(int)); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
307 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
308 #endif |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
309 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
310 void rmd160_init(hash_state * md) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
311 { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
312 _ARGCHK(md != NULL); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
313 md->rmd160.state[0] = 0x67452301UL; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
314 md->rmd160.state[1] = 0xefcdab89UL; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
315 md->rmd160.state[2] = 0x98badcfeUL; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
316 md->rmd160.state[3] = 0x10325476UL; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
317 md->rmd160.state[4] = 0xc3d2e1f0UL; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
318 md->rmd160.curlen = 0; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
319 md->rmd160.length = 0; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
320 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
321 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
322 HASH_PROCESS(rmd160_process, rmd160_compress, rmd160, 64) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
323 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
324 int rmd160_done(hash_state * md, unsigned char *hash) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
325 { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
326 int i; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
327 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
328 _ARGCHK(md != NULL); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
329 _ARGCHK(hash != NULL); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
330 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
331 if (md->rmd160.curlen >= sizeof(md->rmd160.buf)) { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
332 return CRYPT_INVALID_ARG; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
333 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
334 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
335 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
336 /* increase the length of the message */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
337 md->rmd160.length += md->rmd160.curlen * 8; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
338 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
339 /* append the '1' bit */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
340 md->rmd160.buf[md->rmd160.curlen++] = (unsigned char)0x80; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
341 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
342 /* if the length is currently above 56 bytes we append zeros |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
343 * then compress. Then we can fall back to padding zeros and length |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
344 * encoding like normal. |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
345 */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
346 if (md->rmd160.curlen > 56) { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
347 while (md->rmd160.curlen < 64) { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
348 md->rmd160.buf[md->rmd160.curlen++] = (unsigned char)0; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
349 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
350 rmd160_compress(md, md->rmd160.buf); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
351 md->rmd160.curlen = 0; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
352 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
353 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
354 /* pad upto 56 bytes of zeroes */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
355 while (md->rmd160.curlen < 56) { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
356 md->rmd160.buf[md->rmd160.curlen++] = (unsigned char)0; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
357 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
358 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
359 /* store length */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
360 STORE64L(md->rmd160.length, md->rmd160.buf+56); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
361 rmd160_compress(md, md->rmd160.buf); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
362 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
363 /* copy output */ |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
364 for (i = 0; i < 5; i++) { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
365 STORE32L(md->rmd160.state[i], hash+(4*i)); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
366 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
367 #ifdef CLEAN_STACK |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
368 zeromem(md, sizeof(hash_state)); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
369 #endif |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
370 return CRYPT_OK; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
371 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
372 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
373 int rmd160_test(void) |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
374 { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
375 #ifndef LTC_TEST |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
376 return CRYPT_NOP; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
377 #else |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
378 static const struct { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
379 char *msg; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
380 unsigned char md[20]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
381 } tests[] = { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
382 { "", |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
383 { 0x9c, 0x11, 0x85, 0xa5, 0xc5, 0xe9, 0xfc, 0x54, 0x61, 0x28, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
384 0x08, 0x97, 0x7e, 0xe8, 0xf5, 0x48, 0xb2, 0x25, 0x8d, 0x31 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
385 }, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
386 { "a", |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
387 { 0x0b, 0xdc, 0x9d, 0x2d, 0x25, 0x6b, 0x3e, 0xe9, 0xda, 0xae, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
388 0x34, 0x7b, 0xe6, 0xf4, 0xdc, 0x83, 0x5a, 0x46, 0x7f, 0xfe } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
389 }, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
390 { "abc", |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
391 { 0x8e, 0xb2, 0x08, 0xf7, 0xe0, 0x5d, 0x98, 0x7a, 0x9b, 0x04, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
392 0x4a, 0x8e, 0x98, 0xc6, 0xb0, 0x87, 0xf1, 0x5a, 0x0b, 0xfc } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
393 }, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
394 { "message digest", |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
395 { 0x5d, 0x06, 0x89, 0xef, 0x49, 0xd2, 0xfa, 0xe5, 0x72, 0xb8, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
396 0x81, 0xb1, 0x23, 0xa8, 0x5f, 0xfa, 0x21, 0x59, 0x5f, 0x36 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
397 }, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
398 { "abcdefghijklmnopqrstuvwxyz", |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
399 { 0xf7, 0x1c, 0x27, 0x10, 0x9c, 0x69, 0x2c, 0x1b, 0x56, 0xbb, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
400 0xdc, 0xeb, 0x5b, 0x9d, 0x28, 0x65, 0xb3, 0x70, 0x8d, 0xbc } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
401 }, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
402 { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
403 { 0x12, 0xa0, 0x53, 0x38, 0x4a, 0x9c, 0x0c, 0x88, 0xe4, 0x05, |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
404 0xa0, 0x6c, 0x27, 0xdc, 0xf4, 0x9a, 0xda, 0x62, 0xeb, 0x2b } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
405 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
406 }; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
407 int x; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
408 unsigned char buf[20]; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
409 hash_state md; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
410 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
411 for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
412 rmd160_init(&md); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
413 rmd160_process(&md, (unsigned char *)tests[x].msg, strlen(tests[x].msg)); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
414 rmd160_done(&md, buf); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
415 if (memcmp(buf, tests[x].md, 20) != 0) { |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
416 #if 0 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
417 printf("Failed test %d\n", x); |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
418 #endif |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
419 return CRYPT_FAIL_TESTVECTOR; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
420 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
421 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
422 return CRYPT_OK; |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
423 #endif |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
424 } |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
425 |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
426 #endif |
d7da3b1e1540
put back the 0.95 makefile which was inadvertently merged over
Matt Johnston <matt@ucc.asn.au>
parents:
diff
changeset
|
427 |