sha1dc: add collision-detecting sha1 implementation

This is pulled straight from: https://github.com/cr-marcstevens/sha1collisiondetection with no modifications yet (though I've pulled in only the subset of files necessary for Git to use). This is commit 007905a93c973f55b2daed6585f9f6c23545bf66. Further updates can be done like: git checkout -b vendor-sha1dc $this_commit cp /path/to/sha1dc/{LICENSE.txt,lib/*} sha1dc/ git add -A sha1dc git commit -m "update sha1dc" git checkout -b update-sha1dc origin git merge vendor-sha1dc Thanks to both Marc and Dan for making the code fit our needs by doing both optimization work, cutting down on the object size, and doing some syntactic changes to work better with git. And to Linus for kicking off the "diet" work that removed some of the unused code. The license of the sha1dc code is the MIT license, which is obviously compatible with the GPLv2 of git. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 16, 2017 at 18:07 UTC 28dc98e343ca4eb370a29ceec4c19beac9b5c01e
5 files changed +2336
sha1dc/LICENSE.txt new
+30
@@ -0,0 +1,30 @@
1 +MIT License
2 +
3 +Copyright (c) 2017:
4 + Marc Stevens
5 + Cryptology Group
6 + Centrum Wiskunde & Informatica
7 + P.O. Box 94079, 1090 GB Amsterdam, Netherlands
8 + marc@marc-stevens.nl
9 +
10 + Dan Shumow
11 + Microsoft Research
12 + danshu@microsoft.com
13 +
14 +Permission is hereby granted, free of charge, to any person obtaining a copy
15 +of this software and associated documentation files (the "Software"), to deal
16 +in the Software without restriction, including without limitation the rights
17 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 +copies of the Software, and to permit persons to whom the Software is
19 +furnished to do so, subject to the following conditions:
20 +
21 +The above copyright notice and this permission notice shall be included in all
22 +copies or substantial portions of the Software.
23 +
24 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 +SOFTWARE.
sha1dc/sha1.c new
+1792
@@ -0,0 +1,1792 @@
1 +/***
2 +* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow (danshu@microsoft.com)
3 +* Distributed under the MIT Software License.
4 +* See accompanying file LICENSE.txt or copy at
5 +* https://opensource.org/licenses/MIT
6 +***/
7 +
8 +#include <string.h>
9 +#include <memory.h>
10 +#include <stdio.h>
11 +#include <stdlib.h>
12 +
13 +#include "sha1.h"
14 +#include "ubc_check.h"
15 +
16 +
17 +/*
18 + Because Little-Endian architectures are most common,
19 + we only set BIGENDIAN if one of these conditions is met.
20 + Note that all MSFT platforms are little endian,
21 + so none of these will be defined under the MSC compiler.
22 + If you are compiling on a big endian platform and your compiler does not define one of these,
23 + you will have to add whatever macros your tool chain defines to indicate Big-Endianness.
24 + */
25 +#if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || \
26 + (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __BIG_ENDIAN__)) || \
27 + defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
28 + defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
29 +
30 +#define BIGENDIAN (1)
31 +
32 +#endif /*ENDIANNESS SELECTION*/
33 +
34 +#define rotate_right(x,n) (((x)>>(n))|((x)<<(32-(n))))
35 +#define rotate_left(x,n) (((x)<<(n))|((x)>>(32-(n))))
36 +
37 +#define sha1_bswap32(x) \
38 + {x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0xFF00FF); x = (x << 16) | (x >> 16);}
39 +
40 +#define sha1_mix(W, t) (rotate_left(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1))
41 +
42 +#if defined(BIGENDIAN)
43 + #define sha1_load(m, t, temp) { temp = m[t]; }
44 +#else
45 + #define sha1_load(m, t, temp) { temp = m[t]; sha1_bswap32(temp); }
46 +#endif /*define(BIGENDIAN)*/
47 +
48 +#define sha1_store(W, t, x) *(volatile uint32_t *)&W[t] = x
49 +
50 +#define sha1_f1(b,c,d) ((d)^((b)&((c)^(d))))
51 +#define sha1_f2(b,c,d) ((b)^(c)^(d))
52 +#define sha1_f3(b,c,d) (((b)&(c))+((d)&((b)^(c))))
53 +#define sha1_f4(b,c,d) ((b)^(c)^(d))
54 +
55 +#define HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, m, t) \
56 + { e += rotate_left(a, 5) + sha1_f1(b,c,d) + 0x5A827999 + m[t]; b = rotate_left(b, 30); }
57 +#define HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, m, t) \
58 + { e += rotate_left(a, 5) + sha1_f2(b,c,d) + 0x6ED9EBA1 + m[t]; b = rotate_left(b, 30); }
59 +#define HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, m, t) \
60 + { e += rotate_left(a, 5) + sha1_f3(b,c,d) + 0x8F1BBCDC + m[t]; b = rotate_left(b, 30); }
61 +#define HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, m, t) \
62 + { e += rotate_left(a, 5) + sha1_f4(b,c,d) + 0xCA62C1D6 + m[t]; b = rotate_left(b, 30); }
63 +
64 +#define HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(a, b, c, d, e, m, t) \
65 + { b = rotate_right(b, 30); e -= rotate_left(a, 5) + sha1_f1(b,c,d) + 0x5A827999 + m[t]; }
66 +#define HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(a, b, c, d, e, m, t) \
67 + { b = rotate_right(b, 30); e -= rotate_left(a, 5) + sha1_f2(b,c,d) + 0x6ED9EBA1 + m[t]; }
68 +#define HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(a, b, c, d, e, m, t) \
69 + { b = rotate_right(b, 30); e -= rotate_left(a, 5) + sha1_f3(b,c,d) + 0x8F1BBCDC + m[t]; }
70 +#define HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(a, b, c, d, e, m, t) \
71 + { b = rotate_right(b, 30); e -= rotate_left(a, 5) + sha1_f4(b,c,d) + 0xCA62C1D6 + m[t]; }
72 +
73 +#define SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(a, b, c, d, e, m, W, t, temp) \
74 + {sha1_load(m, t, temp); sha1_store(W, t, temp); e += temp + rotate_left(a, 5) + sha1_f1(b,c,d) + 0x5A827999; b = rotate_left(b, 30);}
75 +
76 +#define SHA1COMPRESS_FULL_ROUND1_STEP_EXPAND(a, b, c, d, e, W, t, temp) \
77 + {temp = sha1_mix(W, t); sha1_store(W, t, temp); e += temp + rotate_left(a, 5) + sha1_f1(b,c,d) + 0x5A827999; b = rotate_left(b, 30); }
78 +
79 +#define SHA1COMPRESS_FULL_ROUND2_STEP(a, b, c, d, e, W, t, temp) \
80 + {temp = sha1_mix(W, t); sha1_store(W, t, temp); e += temp + rotate_left(a, 5) + sha1_f2(b,c,d) + 0x6ED9EBA1; b = rotate_left(b, 30); }
81 +
82 +#define SHA1COMPRESS_FULL_ROUND3_STEP(a, b, c, d, e, W, t, temp) \
83 + {temp = sha1_mix(W, t); sha1_store(W, t, temp); e += temp + rotate_left(a, 5) + sha1_f3(b,c,d) + 0x8F1BBCDC; b = rotate_left(b, 30); }
84 +
85 +#define SHA1COMPRESS_FULL_ROUND4_STEP(a, b, c, d, e, W, t, temp) \
86 + {temp = sha1_mix(W, t); sha1_store(W, t, temp); e += temp + rotate_left(a, 5) + sha1_f4(b,c,d) + 0xCA62C1D6; b = rotate_left(b, 30); }
87 +
88 +
89 +#define SHA1_STORE_STATE(i) states[i][0] = a; states[i][1] = b; states[i][2] = c; states[i][3] = d; states[i][4] = e;
90 +
91 +#ifdef BUILDNOCOLLDETECTSHA1COMPRESSION
92 +void sha1_compression(uint32_t ihv[5], const uint32_t m[16])
93 +{
94 + uint32_t W[80];
95 + uint32_t a,b,c,d,e;
96 + unsigned i;
97 +
98 + memcpy(W, m, 16 * 4);
99 + for (i = 16; i < 80; ++i)
100 + W[i] = sha1_mix(W, i);
101 +
102 + a = ihv[0]; b = ihv[1]; c = ihv[2]; d = ihv[3]; e = ihv[4];
103 +
104 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 0);
105 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 1);
106 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 2);
107 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 3);
108 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 4);
109 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 5);
110 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 6);
111 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 7);
112 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 8);
113 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 9);
114 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 10);
115 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 11);
116 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 12);
117 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 13);
118 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 14);
119 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 15);
120 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 16);
121 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 17);
122 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 18);
123 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 19);
124 +
125 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 20);
126 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 21);
127 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 22);
128 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 23);
129 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 24);
130 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 25);
131 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 26);
132 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 27);
133 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 28);
134 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 29);
135 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 30);
136 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 31);
137 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 32);
138 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 33);
139 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 34);
140 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 35);
141 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 36);
142 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 37);
143 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 38);
144 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 39);
145 +
146 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 40);
147 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 41);
148 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 42);
149 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 43);
150 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 44);
151 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 45);
152 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 46);
153 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 47);
154 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 48);
155 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 49);
156 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 50);
157 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 51);
158 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 52);
159 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 53);
160 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 54);
161 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 55);
162 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 56);
163 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 57);
164 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 58);
165 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 59);
166 +
167 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 60);
168 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 61);
169 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 62);
170 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 63);
171 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 64);
172 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 65);
173 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 66);
174 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 67);
175 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 68);
176 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 69);
177 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 70);
178 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 71);
179 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 72);
180 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 73);
181 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 74);
182 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 75);
183 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 76);
184 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 77);
185 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 78);
186 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 79);
187 +
188 + ihv[0] += a; ihv[1] += b; ihv[2] += c; ihv[3] += d; ihv[4] += e;
189 +}
190 +#endif /*BUILDNOCOLLDETECTSHA1COMPRESSION*/
191 +
192 +
193 +static void sha1_compression_W(uint32_t ihv[5], const uint32_t W[80])
194 +{
195 + uint32_t a = ihv[0], b = ihv[1], c = ihv[2], d = ihv[3], e = ihv[4];
196 +
197 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 0);
198 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 1);
199 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 2);
200 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 3);
201 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 4);
202 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 5);
203 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 6);
204 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 7);
205 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 8);
206 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 9);
207 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 10);
208 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 11);
209 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 12);
210 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 13);
211 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 14);
212 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, W, 15);
213 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, W, 16);
214 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, W, 17);
215 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, W, 18);
216 + HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, W, 19);
217 +
218 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 20);
219 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 21);
220 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 22);
221 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 23);
222 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 24);
223 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 25);
224 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 26);
225 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 27);
226 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 28);
227 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 29);
228 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 30);
229 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 31);
230 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 32);
231 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 33);
232 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 34);
233 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, W, 35);
234 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, W, 36);
235 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, W, 37);
236 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, W, 38);
237 + HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, W, 39);
238 +
239 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 40);
240 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 41);
241 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 42);
242 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 43);
243 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 44);
244 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 45);
245 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 46);
246 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 47);
247 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 48);
248 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 49);
249 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 50);
250 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 51);
251 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 52);
252 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 53);
253 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 54);
254 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, W, 55);
255 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, W, 56);
256 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, W, 57);
257 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, W, 58);
258 + HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, W, 59);
259 +
260 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 60);
261 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 61);
262 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 62);
263 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 63);
264 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 64);
265 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 65);
266 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 66);
267 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 67);
268 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 68);
269 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 69);
270 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 70);
271 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 71);
272 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 72);
273 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 73);
274 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 74);
275 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, W, 75);
276 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, W, 76);
277 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, W, 77);
278 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, W, 78);
279 + HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, W, 79);
280 +
281 + ihv[0] += a; ihv[1] += b; ihv[2] += c; ihv[3] += d; ihv[4] += e;
282 +}
283 +
284 +
285 +
286 +void sha1_compression_states(uint32_t ihv[5], const uint32_t m[16], uint32_t W[80], uint32_t states[80][5])
287 +{
288 + uint32_t a = ihv[0], b = ihv[1], c = ihv[2], d = ihv[3], e = ihv[4];
289 + uint32_t temp;
290 +
291 +#ifdef DOSTORESTATE00
292 + SHA1_STORE_STATE(0)
293 +#endif
294 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(a, b, c, d, e, m, W, 0, temp);
295 +
296 +#ifdef DOSTORESTATE01
297 + SHA1_STORE_STATE(1)
298 +#endif
299 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(e, a, b, c, d, m, W, 1, temp);
300 +
301 +#ifdef DOSTORESTATE02
302 + SHA1_STORE_STATE(2)
303 +#endif
304 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(d, e, a, b, c, m, W, 2, temp);
305 +
306 +#ifdef DOSTORESTATE03
307 + SHA1_STORE_STATE(3)
308 +#endif
309 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(c, d, e, a, b, m, W, 3, temp);
310 +
311 +#ifdef DOSTORESTATE04
312 + SHA1_STORE_STATE(4)
313 +#endif
314 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(b, c, d, e, a, m, W, 4, temp);
315 +
316 +#ifdef DOSTORESTATE05
317 + SHA1_STORE_STATE(5)
318 +#endif
319 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(a, b, c, d, e, m, W, 5, temp);
320 +
321 +#ifdef DOSTORESTATE06
322 + SHA1_STORE_STATE(6)
323 +#endif
324 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(e, a, b, c, d, m, W, 6, temp);
325 +
326 +#ifdef DOSTORESTATE07
327 + SHA1_STORE_STATE(7)
328 +#endif
329 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(d, e, a, b, c, m, W, 7, temp);
330 +
331 +#ifdef DOSTORESTATE08
332 + SHA1_STORE_STATE(8)
333 +#endif
334 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(c, d, e, a, b, m, W, 8, temp);
335 +
336 +#ifdef DOSTORESTATE09
337 + SHA1_STORE_STATE(9)
338 +#endif
339 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(b, c, d, e, a, m, W, 9, temp);
340 +
341 +#ifdef DOSTORESTATE10
342 + SHA1_STORE_STATE(10)
343 +#endif
344 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(a, b, c, d, e, m, W, 10, temp);
345 +
346 +#ifdef DOSTORESTATE11
347 + SHA1_STORE_STATE(11)
348 +#endif
349 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(e, a, b, c, d, m, W, 11, temp);
350 +
351 +#ifdef DOSTORESTATE12
352 + SHA1_STORE_STATE(12)
353 +#endif
354 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(d, e, a, b, c, m, W, 12, temp);
355 +
356 +#ifdef DOSTORESTATE13
357 + SHA1_STORE_STATE(13)
358 +#endif
359 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(c, d, e, a, b, m, W, 13, temp);
360 +
361 +#ifdef DOSTORESTATE14
362 + SHA1_STORE_STATE(14)
363 +#endif
364 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(b, c, d, e, a, m, W, 14, temp);
365 +
366 +#ifdef DOSTORESTATE15
367 + SHA1_STORE_STATE(15)
368 +#endif
369 + SHA1COMPRESS_FULL_ROUND1_STEP_LOAD(a, b, c, d, e, m, W, 15, temp);
370 +
371 +#ifdef DOSTORESTATE16
372 + SHA1_STORE_STATE(16)
373 +#endif
374 + SHA1COMPRESS_FULL_ROUND1_STEP_EXPAND(e, a, b, c, d, W, 16, temp);
375 +
376 +#ifdef DOSTORESTATE17
377 + SHA1_STORE_STATE(17)
378 +#endif
379 + SHA1COMPRESS_FULL_ROUND1_STEP_EXPAND(d, e, a, b, c, W, 17, temp);
380 +
381 +#ifdef DOSTORESTATE18
382 + SHA1_STORE_STATE(18)
383 +#endif
384 + SHA1COMPRESS_FULL_ROUND1_STEP_EXPAND(c, d, e, a, b, W, 18, temp);
385 +
386 +#ifdef DOSTORESTATE19
387 + SHA1_STORE_STATE(19)
388 +#endif
389 + SHA1COMPRESS_FULL_ROUND1_STEP_EXPAND(b, c, d, e, a, W, 19, temp);
390 +
391 +
392 +
393 +#ifdef DOSTORESTATE20
394 + SHA1_STORE_STATE(20)
395 +#endif
396 + SHA1COMPRESS_FULL_ROUND2_STEP(a, b, c, d, e, W, 20, temp);
397 +
398 +#ifdef DOSTORESTATE21
399 + SHA1_STORE_STATE(21)
400 +#endif
401 + SHA1COMPRESS_FULL_ROUND2_STEP(e, a, b, c, d, W, 21, temp);
402 +
403 +#ifdef DOSTORESTATE22
404 + SHA1_STORE_STATE(22)
405 +#endif
406 + SHA1COMPRESS_FULL_ROUND2_STEP(d, e, a, b, c, W, 22, temp);
407 +
408 +#ifdef DOSTORESTATE23
409 + SHA1_STORE_STATE(23)
410 +#endif
411 + SHA1COMPRESS_FULL_ROUND2_STEP(c, d, e, a, b, W, 23, temp);
412 +
413 +#ifdef DOSTORESTATE24
414 + SHA1_STORE_STATE(24)
415 +#endif
416 + SHA1COMPRESS_FULL_ROUND2_STEP(b, c, d, e, a, W, 24, temp);
417 +
418 +#ifdef DOSTORESTATE25
419 + SHA1_STORE_STATE(25)
420 +#endif
421 + SHA1COMPRESS_FULL_ROUND2_STEP(a, b, c, d, e, W, 25, temp);
422 +
423 +#ifdef DOSTORESTATE26
424 + SHA1_STORE_STATE(26)
425 +#endif
426 + SHA1COMPRESS_FULL_ROUND2_STEP(e, a, b, c, d, W, 26, temp);
427 +
428 +#ifdef DOSTORESTATE27
429 + SHA1_STORE_STATE(27)
430 +#endif
431 + SHA1COMPRESS_FULL_ROUND2_STEP(d, e, a, b, c, W, 27, temp);
432 +
433 +#ifdef DOSTORESTATE28
434 + SHA1_STORE_STATE(28)
435 +#endif
436 + SHA1COMPRESS_FULL_ROUND2_STEP(c, d, e, a, b, W, 28, temp);
437 +
438 +#ifdef DOSTORESTATE29
439 + SHA1_STORE_STATE(29)
440 +#endif
441 + SHA1COMPRESS_FULL_ROUND2_STEP(b, c, d, e, a, W, 29, temp);
442 +
443 +#ifdef DOSTORESTATE30
444 + SHA1_STORE_STATE(30)
445 +#endif
446 + SHA1COMPRESS_FULL_ROUND2_STEP(a, b, c, d, e, W, 30, temp);
447 +
448 +#ifdef DOSTORESTATE31
449 + SHA1_STORE_STATE(31)
450 +#endif
451 + SHA1COMPRESS_FULL_ROUND2_STEP(e, a, b, c, d, W, 31, temp);
452 +
453 +#ifdef DOSTORESTATE32
454 + SHA1_STORE_STATE(32)
455 +#endif
456 + SHA1COMPRESS_FULL_ROUND2_STEP(d, e, a, b, c, W, 32, temp);
457 +
458 +#ifdef DOSTORESTATE33
459 + SHA1_STORE_STATE(33)
460 +#endif
461 + SHA1COMPRESS_FULL_ROUND2_STEP(c, d, e, a, b, W, 33, temp);
462 +
463 +#ifdef DOSTORESTATE34
464 + SHA1_STORE_STATE(34)
465 +#endif
466 + SHA1COMPRESS_FULL_ROUND2_STEP(b, c, d, e, a, W, 34, temp);
467 +
468 +#ifdef DOSTORESTATE35
469 + SHA1_STORE_STATE(35)
470 +#endif
471 + SHA1COMPRESS_FULL_ROUND2_STEP(a, b, c, d, e, W, 35, temp);
472 +
473 +#ifdef DOSTORESTATE36
474 + SHA1_STORE_STATE(36)
475 +#endif
476 + SHA1COMPRESS_FULL_ROUND2_STEP(e, a, b, c, d, W, 36, temp);
477 +
478 +#ifdef DOSTORESTATE37
479 + SHA1_STORE_STATE(37)
480 +#endif
481 + SHA1COMPRESS_FULL_ROUND2_STEP(d, e, a, b, c, W, 37, temp);
482 +
483 +#ifdef DOSTORESTATE38
484 + SHA1_STORE_STATE(38)
485 +#endif
486 + SHA1COMPRESS_FULL_ROUND2_STEP(c, d, e, a, b, W, 38, temp);
487 +
488 +#ifdef DOSTORESTATE39
489 + SHA1_STORE_STATE(39)
490 +#endif
491 + SHA1COMPRESS_FULL_ROUND2_STEP(b, c, d, e, a, W, 39, temp);
492 +
493 +
494 +
495 +#ifdef DOSTORESTATE40
496 + SHA1_STORE_STATE(40)
497 +#endif
498 + SHA1COMPRESS_FULL_ROUND3_STEP(a, b, c, d, e, W, 40, temp);
499 +
500 +#ifdef DOSTORESTATE41
501 + SHA1_STORE_STATE(41)
502 +#endif
503 + SHA1COMPRESS_FULL_ROUND3_STEP(e, a, b, c, d, W, 41, temp);
504 +
505 +#ifdef DOSTORESTATE42
506 + SHA1_STORE_STATE(42)
507 +#endif
508 + SHA1COMPRESS_FULL_ROUND3_STEP(d, e, a, b, c, W, 42, temp);
509 +
510 +#ifdef DOSTORESTATE43
511 + SHA1_STORE_STATE(43)
512 +#endif
513 + SHA1COMPRESS_FULL_ROUND3_STEP(c, d, e, a, b, W, 43, temp);
514 +
515 +#ifdef DOSTORESTATE44
516 + SHA1_STORE_STATE(44)
517 +#endif
518 + SHA1COMPRESS_FULL_ROUND3_STEP(b, c, d, e, a, W, 44, temp);
519 +
520 +#ifdef DOSTORESTATE45
521 + SHA1_STORE_STATE(45)
522 +#endif
523 + SHA1COMPRESS_FULL_ROUND3_STEP(a, b, c, d, e, W, 45, temp);
524 +
525 +#ifdef DOSTORESTATE46
526 + SHA1_STORE_STATE(46)
527 +#endif
528 + SHA1COMPRESS_FULL_ROUND3_STEP(e, a, b, c, d, W, 46, temp);
529 +
530 +#ifdef DOSTORESTATE47
531 + SHA1_STORE_STATE(47)
532 +#endif
533 + SHA1COMPRESS_FULL_ROUND3_STEP(d, e, a, b, c, W, 47, temp);
534 +
535 +#ifdef DOSTORESTATE48
536 + SHA1_STORE_STATE(48)
537 +#endif
538 + SHA1COMPRESS_FULL_ROUND3_STEP(c, d, e, a, b, W, 48, temp);
539 +
540 +#ifdef DOSTORESTATE49
541 + SHA1_STORE_STATE(49)
542 +#endif
543 + SHA1COMPRESS_FULL_ROUND3_STEP(b, c, d, e, a, W, 49, temp);
544 +
545 +#ifdef DOSTORESTATE50
546 + SHA1_STORE_STATE(50)
547 +#endif
548 + SHA1COMPRESS_FULL_ROUND3_STEP(a, b, c, d, e, W, 50, temp);
549 +
550 +#ifdef DOSTORESTATE51
551 + SHA1_STORE_STATE(51)
552 +#endif
553 + SHA1COMPRESS_FULL_ROUND3_STEP(e, a, b, c, d, W, 51, temp);
554 +
555 +#ifdef DOSTORESTATE52
556 + SHA1_STORE_STATE(52)
557 +#endif
558 + SHA1COMPRESS_FULL_ROUND3_STEP(d, e, a, b, c, W, 52, temp);
559 +
560 +#ifdef DOSTORESTATE53
561 + SHA1_STORE_STATE(53)
562 +#endif
563 + SHA1COMPRESS_FULL_ROUND3_STEP(c, d, e, a, b, W, 53, temp);
564 +
565 +#ifdef DOSTORESTATE54
566 + SHA1_STORE_STATE(54)
567 +#endif
568 + SHA1COMPRESS_FULL_ROUND3_STEP(b, c, d, e, a, W, 54, temp);
569 +
570 +#ifdef DOSTORESTATE55
571 + SHA1_STORE_STATE(55)
572 +#endif
573 + SHA1COMPRESS_FULL_ROUND3_STEP(a, b, c, d, e, W, 55, temp);
574 +
575 +#ifdef DOSTORESTATE56
576 + SHA1_STORE_STATE(56)
577 +#endif
578 + SHA1COMPRESS_FULL_ROUND3_STEP(e, a, b, c, d, W, 56, temp);
579 +
580 +#ifdef DOSTORESTATE57
581 + SHA1_STORE_STATE(57)
582 +#endif
583 + SHA1COMPRESS_FULL_ROUND3_STEP(d, e, a, b, c, W, 57, temp);
584 +
585 +#ifdef DOSTORESTATE58
586 + SHA1_STORE_STATE(58)
587 +#endif
588 + SHA1COMPRESS_FULL_ROUND3_STEP(c, d, e, a, b, W, 58, temp);
589 +
590 +#ifdef DOSTORESTATE59
591 + SHA1_STORE_STATE(59)
592 +#endif
593 + SHA1COMPRESS_FULL_ROUND3_STEP(b, c, d, e, a, W, 59, temp);
594 +
595 +
596 +
597 +
598 +#ifdef DOSTORESTATE60
599 + SHA1_STORE_STATE(60)
600 +#endif
601 + SHA1COMPRESS_FULL_ROUND4_STEP(a, b, c, d, e, W, 60, temp);
602 +
603 +#ifdef DOSTORESTATE61
604 + SHA1_STORE_STATE(61)
605 +#endif
606 + SHA1COMPRESS_FULL_ROUND4_STEP(e, a, b, c, d, W, 61, temp);
607 +
608 +#ifdef DOSTORESTATE62
609 + SHA1_STORE_STATE(62)
610 +#endif
611 + SHA1COMPRESS_FULL_ROUND4_STEP(d, e, a, b, c, W, 62, temp);
612 +
613 +#ifdef DOSTORESTATE63
614 + SHA1_STORE_STATE(63)
615 +#endif
616 + SHA1COMPRESS_FULL_ROUND4_STEP(c, d, e, a, b, W, 63, temp);
617 +
618 +#ifdef DOSTORESTATE64
619 + SHA1_STORE_STATE(64)
620 +#endif
621 + SHA1COMPRESS_FULL_ROUND4_STEP(b, c, d, e, a, W, 64, temp);
622 +
623 +#ifdef DOSTORESTATE65
624 + SHA1_STORE_STATE(65)
625 +#endif
626 + SHA1COMPRESS_FULL_ROUND4_STEP(a, b, c, d, e, W, 65, temp);
627 +
628 +#ifdef DOSTORESTATE66
629 + SHA1_STORE_STATE(66)
630 +#endif
631 + SHA1COMPRESS_FULL_ROUND4_STEP(e, a, b, c, d, W, 66, temp);
632 +
633 +#ifdef DOSTORESTATE67
634 + SHA1_STORE_STATE(67)
635 +#endif
636 + SHA1COMPRESS_FULL_ROUND4_STEP(d, e, a, b, c, W, 67, temp);
637 +
638 +#ifdef DOSTORESTATE68
639 + SHA1_STORE_STATE(68)
640 +#endif
641 + SHA1COMPRESS_FULL_ROUND4_STEP(c, d, e, a, b, W, 68, temp);
642 +
643 +#ifdef DOSTORESTATE69
644 + SHA1_STORE_STATE(69)
645 +#endif
646 + SHA1COMPRESS_FULL_ROUND4_STEP(b, c, d, e, a, W, 69, temp);
647 +
648 +#ifdef DOSTORESTATE70
649 + SHA1_STORE_STATE(70)
650 +#endif
651 + SHA1COMPRESS_FULL_ROUND4_STEP(a, b, c, d, e, W, 70, temp);
652 +
653 +#ifdef DOSTORESTATE71
654 + SHA1_STORE_STATE(71)
655 +#endif
656 + SHA1COMPRESS_FULL_ROUND4_STEP(e, a, b, c, d, W, 71, temp);
657 +
658 +#ifdef DOSTORESTATE72
659 + SHA1_STORE_STATE(72)
660 +#endif
661 + SHA1COMPRESS_FULL_ROUND4_STEP(d, e, a, b, c, W, 72, temp);
662 +
663 +#ifdef DOSTORESTATE73
664 + SHA1_STORE_STATE(73)
665 +#endif
666 + SHA1COMPRESS_FULL_ROUND4_STEP(c, d, e, a, b, W, 73, temp);
667 +
668 +#ifdef DOSTORESTATE74
669 + SHA1_STORE_STATE(74)
670 +#endif
671 + SHA1COMPRESS_FULL_ROUND4_STEP(b, c, d, e, a, W, 74, temp);
672 +
673 +#ifdef DOSTORESTATE75
674 + SHA1_STORE_STATE(75)
675 +#endif
676 + SHA1COMPRESS_FULL_ROUND4_STEP(a, b, c, d, e, W, 75, temp);
677 +
678 +#ifdef DOSTORESTATE76
679 + SHA1_STORE_STATE(76)
680 +#endif
681 + SHA1COMPRESS_FULL_ROUND4_STEP(e, a, b, c, d, W, 76, temp);
682 +
683 +#ifdef DOSTORESTATE77
684 + SHA1_STORE_STATE(77)
685 +#endif
686 + SHA1COMPRESS_FULL_ROUND4_STEP(d, e, a, b, c, W, 77, temp);
687 +
688 +#ifdef DOSTORESTATE78
689 + SHA1_STORE_STATE(78)
690 +#endif
691 + SHA1COMPRESS_FULL_ROUND4_STEP(c, d, e, a, b, W, 78, temp);
692 +
693 +#ifdef DOSTORESTATE79
694 + SHA1_STORE_STATE(79)
695 +#endif
696 + SHA1COMPRESS_FULL_ROUND4_STEP(b, c, d, e, a, W, 79, temp);
697 +
698 +
699 +
700 + ihv[0] += a; ihv[1] += b; ihv[2] += c; ihv[3] += d; ihv[4] += e;
701 +}
702 +
703 +
704 +
705 +
706 +#define SHA1_RECOMPRESS(t) \
707 +static void sha1recompress_fast_ ## t (uint32_t ihvin[5], uint32_t ihvout[5], const uint32_t me2[80], const uint32_t state[5]) \
708 +{ \
709 + uint32_t a = state[0], b = state[1], c = state[2], d = state[3], e = state[4]; \
710 + if (t > 79) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(b, c, d, e, a, me2, 79); \
711 + if (t > 78) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(c, d, e, a, b, me2, 78); \
712 + if (t > 77) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(d, e, a, b, c, me2, 77); \
713 + if (t > 76) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(e, a, b, c, d, me2, 76); \
714 + if (t > 75) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(a, b, c, d, e, me2, 75); \
715 + if (t > 74) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(b, c, d, e, a, me2, 74); \
716 + if (t > 73) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(c, d, e, a, b, me2, 73); \
717 + if (t > 72) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(d, e, a, b, c, me2, 72); \
718 + if (t > 71) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(e, a, b, c, d, me2, 71); \
719 + if (t > 70) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(a, b, c, d, e, me2, 70); \
720 + if (t > 69) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(b, c, d, e, a, me2, 69); \
721 + if (t > 68) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(c, d, e, a, b, me2, 68); \
722 + if (t > 67) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(d, e, a, b, c, me2, 67); \
723 + if (t > 66) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(e, a, b, c, d, me2, 66); \
724 + if (t > 65) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(a, b, c, d, e, me2, 65); \
725 + if (t > 64) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(b, c, d, e, a, me2, 64); \
726 + if (t > 63) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(c, d, e, a, b, me2, 63); \
727 + if (t > 62) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(d, e, a, b, c, me2, 62); \
728 + if (t > 61) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(e, a, b, c, d, me2, 61); \
729 + if (t > 60) HASHCLASH_SHA1COMPRESS_ROUND4_STEP_BW(a, b, c, d, e, me2, 60); \
730 + if (t > 59) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(b, c, d, e, a, me2, 59); \
731 + if (t > 58) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(c, d, e, a, b, me2, 58); \
732 + if (t > 57) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(d, e, a, b, c, me2, 57); \
733 + if (t > 56) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(e, a, b, c, d, me2, 56); \
734 + if (t > 55) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(a, b, c, d, e, me2, 55); \
735 + if (t > 54) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(b, c, d, e, a, me2, 54); \
736 + if (t > 53) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(c, d, e, a, b, me2, 53); \
737 + if (t > 52) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(d, e, a, b, c, me2, 52); \
738 + if (t > 51) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(e, a, b, c, d, me2, 51); \
739 + if (t > 50) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(a, b, c, d, e, me2, 50); \
740 + if (t > 49) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(b, c, d, e, a, me2, 49); \
741 + if (t > 48) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(c, d, e, a, b, me2, 48); \
742 + if (t > 47) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(d, e, a, b, c, me2, 47); \
743 + if (t > 46) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(e, a, b, c, d, me2, 46); \
744 + if (t > 45) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(a, b, c, d, e, me2, 45); \
745 + if (t > 44) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(b, c, d, e, a, me2, 44); \
746 + if (t > 43) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(c, d, e, a, b, me2, 43); \
747 + if (t > 42) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(d, e, a, b, c, me2, 42); \
748 + if (t > 41) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(e, a, b, c, d, me2, 41); \
749 + if (t > 40) HASHCLASH_SHA1COMPRESS_ROUND3_STEP_BW(a, b, c, d, e, me2, 40); \
750 + if (t > 39) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(b, c, d, e, a, me2, 39); \
751 + if (t > 38) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(c, d, e, a, b, me2, 38); \
752 + if (t > 37) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(d, e, a, b, c, me2, 37); \
753 + if (t > 36) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(e, a, b, c, d, me2, 36); \
754 + if (t > 35) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(a, b, c, d, e, me2, 35); \
755 + if (t > 34) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(b, c, d, e, a, me2, 34); \
756 + if (t > 33) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(c, d, e, a, b, me2, 33); \
757 + if (t > 32) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(d, e, a, b, c, me2, 32); \
758 + if (t > 31) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(e, a, b, c, d, me2, 31); \
759 + if (t > 30) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(a, b, c, d, e, me2, 30); \
760 + if (t > 29) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(b, c, d, e, a, me2, 29); \
761 + if (t > 28) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(c, d, e, a, b, me2, 28); \
762 + if (t > 27) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(d, e, a, b, c, me2, 27); \
763 + if (t > 26) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(e, a, b, c, d, me2, 26); \
764 + if (t > 25) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(a, b, c, d, e, me2, 25); \
765 + if (t > 24) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(b, c, d, e, a, me2, 24); \
766 + if (t > 23) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(c, d, e, a, b, me2, 23); \
767 + if (t > 22) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(d, e, a, b, c, me2, 22); \
768 + if (t > 21) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(e, a, b, c, d, me2, 21); \
769 + if (t > 20) HASHCLASH_SHA1COMPRESS_ROUND2_STEP_BW(a, b, c, d, e, me2, 20); \
770 + if (t > 19) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(b, c, d, e, a, me2, 19); \
771 + if (t > 18) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(c, d, e, a, b, me2, 18); \
772 + if (t > 17) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(d, e, a, b, c, me2, 17); \
773 + if (t > 16) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(e, a, b, c, d, me2, 16); \
774 + if (t > 15) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(a, b, c, d, e, me2, 15); \
775 + if (t > 14) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(b, c, d, e, a, me2, 14); \
776 + if (t > 13) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(c, d, e, a, b, me2, 13); \
777 + if (t > 12) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(d, e, a, b, c, me2, 12); \
778 + if (t > 11) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(e, a, b, c, d, me2, 11); \
779 + if (t > 10) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(a, b, c, d, e, me2, 10); \
780 + if (t > 9) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(b, c, d, e, a, me2, 9); \
781 + if (t > 8) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(c, d, e, a, b, me2, 8); \
782 + if (t > 7) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(d, e, a, b, c, me2, 7); \
783 + if (t > 6) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(e, a, b, c, d, me2, 6); \
784 + if (t > 5) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(a, b, c, d, e, me2, 5); \
785 + if (t > 4) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(b, c, d, e, a, me2, 4); \
786 + if (t > 3) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(c, d, e, a, b, me2, 3); \
787 + if (t > 2) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(d, e, a, b, c, me2, 2); \
788 + if (t > 1) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(e, a, b, c, d, me2, 1); \
789 + if (t > 0) HASHCLASH_SHA1COMPRESS_ROUND1_STEP_BW(a, b, c, d, e, me2, 0); \
790 + ihvin[0] = a; ihvin[1] = b; ihvin[2] = c; ihvin[3] = d; ihvin[4] = e; \
791 + a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; \
792 + if (t <= 0) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, me2, 0); \
793 + if (t <= 1) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, me2, 1); \
794 + if (t <= 2) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, me2, 2); \
795 + if (t <= 3) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, me2, 3); \
796 + if (t <= 4) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, me2, 4); \
797 + if (t <= 5) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, me2, 5); \
798 + if (t <= 6) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, me2, 6); \
799 + if (t <= 7) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, me2, 7); \
800 + if (t <= 8) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, me2, 8); \
801 + if (t <= 9) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, me2, 9); \
802 + if (t <= 10) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, me2, 10); \
803 + if (t <= 11) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, me2, 11); \
804 + if (t <= 12) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, me2, 12); \
805 + if (t <= 13) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, me2, 13); \
806 + if (t <= 14) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, me2, 14); \
807 + if (t <= 15) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(a, b, c, d, e, me2, 15); \
808 + if (t <= 16) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(e, a, b, c, d, me2, 16); \
809 + if (t <= 17) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(d, e, a, b, c, me2, 17); \
810 + if (t <= 18) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(c, d, e, a, b, me2, 18); \
811 + if (t <= 19) HASHCLASH_SHA1COMPRESS_ROUND1_STEP(b, c, d, e, a, me2, 19); \
812 + if (t <= 20) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, me2, 20); \
813 + if (t <= 21) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, me2, 21); \
814 + if (t <= 22) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, me2, 22); \
815 + if (t <= 23) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, me2, 23); \
816 + if (t <= 24) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, me2, 24); \
817 + if (t <= 25) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, me2, 25); \
818 + if (t <= 26) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, me2, 26); \
819 + if (t <= 27) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, me2, 27); \
820 + if (t <= 28) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, me2, 28); \
821 + if (t <= 29) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, me2, 29); \
822 + if (t <= 30) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, me2, 30); \
823 + if (t <= 31) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, me2, 31); \
824 + if (t <= 32) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, me2, 32); \
825 + if (t <= 33) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, me2, 33); \
826 + if (t <= 34) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, me2, 34); \
827 + if (t <= 35) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(a, b, c, d, e, me2, 35); \
828 + if (t <= 36) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(e, a, b, c, d, me2, 36); \
829 + if (t <= 37) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(d, e, a, b, c, me2, 37); \
830 + if (t <= 38) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(c, d, e, a, b, me2, 38); \
831 + if (t <= 39) HASHCLASH_SHA1COMPRESS_ROUND2_STEP(b, c, d, e, a, me2, 39); \
832 + if (t <= 40) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, me2, 40); \
833 + if (t <= 41) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, me2, 41); \
834 + if (t <= 42) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, me2, 42); \
835 + if (t <= 43) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, me2, 43); \
836 + if (t <= 44) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, me2, 44); \
837 + if (t <= 45) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, me2, 45); \
838 + if (t <= 46) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, me2, 46); \
839 + if (t <= 47) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, me2, 47); \
840 + if (t <= 48) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, me2, 48); \
841 + if (t <= 49) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, me2, 49); \
842 + if (t <= 50) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, me2, 50); \
843 + if (t <= 51) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, me2, 51); \
844 + if (t <= 52) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, me2, 52); \
845 + if (t <= 53) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, me2, 53); \
846 + if (t <= 54) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, me2, 54); \
847 + if (t <= 55) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(a, b, c, d, e, me2, 55); \
848 + if (t <= 56) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(e, a, b, c, d, me2, 56); \
849 + if (t <= 57) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(d, e, a, b, c, me2, 57); \
850 + if (t <= 58) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(c, d, e, a, b, me2, 58); \
851 + if (t <= 59) HASHCLASH_SHA1COMPRESS_ROUND3_STEP(b, c, d, e, a, me2, 59); \
852 + if (t <= 60) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, me2, 60); \
853 + if (t <= 61) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, me2, 61); \
854 + if (t <= 62) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, me2, 62); \
855 + if (t <= 63) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, me2, 63); \
856 + if (t <= 64) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, me2, 64); \
857 + if (t <= 65) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, me2, 65); \
858 + if (t <= 66) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, me2, 66); \
859 + if (t <= 67) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, me2, 67); \
860 + if (t <= 68) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, me2, 68); \
861 + if (t <= 69) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, me2, 69); \
862 + if (t <= 70) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, me2, 70); \
863 + if (t <= 71) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, me2, 71); \
864 + if (t <= 72) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, me2, 72); \
865 + if (t <= 73) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, me2, 73); \
866 + if (t <= 74) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, me2, 74); \
867 + if (t <= 75) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(a, b, c, d, e, me2, 75); \
868 + if (t <= 76) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(e, a, b, c, d, me2, 76); \
869 + if (t <= 77) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(d, e, a, b, c, me2, 77); \
870 + if (t <= 78) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(c, d, e, a, b, me2, 78); \
871 + if (t <= 79) HASHCLASH_SHA1COMPRESS_ROUND4_STEP(b, c, d, e, a, me2, 79); \
872 + ihvout[0] = ihvin[0] + a; ihvout[1] = ihvin[1] + b; ihvout[2] = ihvin[2] + c; ihvout[3] = ihvin[3] + d; ihvout[4] = ihvin[4] + e; \
873 +}
874 +
875 +#ifdef DOSTORESTATE0
876 +SHA1_RECOMPRESS(0)
877 +#endif
878 +
879 +#ifdef DOSTORESTATE1
880 +SHA1_RECOMPRESS(1)
881 +#endif
882 +
883 +#ifdef DOSTORESTATE2
884 +SHA1_RECOMPRESS(2)
885 +#endif
886 +
887 +#ifdef DOSTORESTATE3
888 +SHA1_RECOMPRESS(3)
889 +#endif
890 +
891 +#ifdef DOSTORESTATE4
892 +SHA1_RECOMPRESS(4)
893 +#endif
894 +
895 +#ifdef DOSTORESTATE5
896 +SHA1_RECOMPRESS(5)
897 +#endif
898 +
899 +#ifdef DOSTORESTATE6
900 +SHA1_RECOMPRESS(6)
901 +#endif
902 +
903 +#ifdef DOSTORESTATE7
904 +SHA1_RECOMPRESS(7)
905 +#endif
906 +
907 +#ifdef DOSTORESTATE8
908 +SHA1_RECOMPRESS(8)
909 +#endif
910 +
911 +#ifdef DOSTORESTATE9
912 +SHA1_RECOMPRESS(9)
913 +#endif
914 +
915 +#ifdef DOSTORESTATE10
916 +SHA1_RECOMPRESS(10)
917 +#endif
918 +
919 +#ifdef DOSTORESTATE11
920 +SHA1_RECOMPRESS(11)
921 +#endif
922 +
923 +#ifdef DOSTORESTATE12
924 +SHA1_RECOMPRESS(12)
925 +#endif
926 +
927 +#ifdef DOSTORESTATE13
928 +SHA1_RECOMPRESS(13)
929 +#endif
930 +
931 +#ifdef DOSTORESTATE14
932 +SHA1_RECOMPRESS(14)
933 +#endif
934 +
935 +#ifdef DOSTORESTATE15
936 +SHA1_RECOMPRESS(15)
937 +#endif
938 +
939 +#ifdef DOSTORESTATE16
940 +SHA1_RECOMPRESS(16)
941 +#endif
942 +
943 +#ifdef DOSTORESTATE17
944 +SHA1_RECOMPRESS(17)
945 +#endif
946 +
947 +#ifdef DOSTORESTATE18
948 +SHA1_RECOMPRESS(18)
949 +#endif
950 +
951 +#ifdef DOSTORESTATE19
952 +SHA1_RECOMPRESS(19)
953 +#endif
954 +
955 +#ifdef DOSTORESTATE20
956 +SHA1_RECOMPRESS(20)
957 +#endif
958 +
959 +#ifdef DOSTORESTATE21
960 +SHA1_RECOMPRESS(21)
961 +#endif
962 +
963 +#ifdef DOSTORESTATE22
964 +SHA1_RECOMPRESS(22)
965 +#endif
966 +
967 +#ifdef DOSTORESTATE23
968 +SHA1_RECOMPRESS(23)
969 +#endif
970 +
971 +#ifdef DOSTORESTATE24
972 +SHA1_RECOMPRESS(24)
973 +#endif
974 +
975 +#ifdef DOSTORESTATE25
976 +SHA1_RECOMPRESS(25)
977 +#endif
978 +
979 +#ifdef DOSTORESTATE26
980 +SHA1_RECOMPRESS(26)
981 +#endif
982 +
983 +#ifdef DOSTORESTATE27
984 +SHA1_RECOMPRESS(27)
985 +#endif
986 +
987 +#ifdef DOSTORESTATE28
988 +SHA1_RECOMPRESS(28)
989 +#endif
990 +
991 +#ifdef DOSTORESTATE29
992 +SHA1_RECOMPRESS(29)
993 +#endif
994 +
995 +#ifdef DOSTORESTATE30
996 +SHA1_RECOMPRESS(30)
997 +#endif
998 +
999 +#ifdef DOSTORESTATE31
1000 +SHA1_RECOMPRESS(31)
1001 +#endif
1002 +
1003 +#ifdef DOSTORESTATE32
1004 +SHA1_RECOMPRESS(32)
1005 +#endif
1006 +
1007 +#ifdef DOSTORESTATE33
1008 +SHA1_RECOMPRESS(33)
1009 +#endif
1010 +
1011 +#ifdef DOSTORESTATE34
1012 +SHA1_RECOMPRESS(34)
1013 +#endif
1014 +
1015 +#ifdef DOSTORESTATE35
1016 +SHA1_RECOMPRESS(35)
1017 +#endif
1018 +
1019 +#ifdef DOSTORESTATE36
1020 +SHA1_RECOMPRESS(36)
1021 +#endif
1022 +
1023 +#ifdef DOSTORESTATE37
1024 +SHA1_RECOMPRESS(37)
1025 +#endif
1026 +
1027 +#ifdef DOSTORESTATE38
1028 +SHA1_RECOMPRESS(38)
1029 +#endif
1030 +
1031 +#ifdef DOSTORESTATE39
1032 +SHA1_RECOMPRESS(39)
1033 +#endif
1034 +
1035 +#ifdef DOSTORESTATE40
1036 +SHA1_RECOMPRESS(40)
1037 +#endif
1038 +
1039 +#ifdef DOSTORESTATE41
1040 +SHA1_RECOMPRESS(41)
1041 +#endif
1042 +
1043 +#ifdef DOSTORESTATE42
1044 +SHA1_RECOMPRESS(42)
1045 +#endif
1046 +
1047 +#ifdef DOSTORESTATE43
1048 +SHA1_RECOMPRESS(43)
1049 +#endif
1050 +
1051 +#ifdef DOSTORESTATE44
1052 +SHA1_RECOMPRESS(44)
1053 +#endif
1054 +
1055 +#ifdef DOSTORESTATE45
1056 +SHA1_RECOMPRESS(45)
1057 +#endif
1058 +
1059 +#ifdef DOSTORESTATE46
1060 +SHA1_RECOMPRESS(46)
1061 +#endif
1062 +
1063 +#ifdef DOSTORESTATE47
1064 +SHA1_RECOMPRESS(47)
1065 +#endif
1066 +
1067 +#ifdef DOSTORESTATE48
1068 +SHA1_RECOMPRESS(48)
1069 +#endif
1070 +
1071 +#ifdef DOSTORESTATE49
1072 +SHA1_RECOMPRESS(49)
1073 +#endif
1074 +
1075 +#ifdef DOSTORESTATE50
1076 +SHA1_RECOMPRESS(50)
1077 +#endif
1078 +
1079 +#ifdef DOSTORESTATE51
1080 +SHA1_RECOMPRESS(51)
1081 +#endif
1082 +
1083 +#ifdef DOSTORESTATE52
1084 +SHA1_RECOMPRESS(52)
1085 +#endif
1086 +
1087 +#ifdef DOSTORESTATE53
1088 +SHA1_RECOMPRESS(53)
1089 +#endif
1090 +
1091 +#ifdef DOSTORESTATE54
1092 +SHA1_RECOMPRESS(54)
1093 +#endif
1094 +
1095 +#ifdef DOSTORESTATE55
1096 +SHA1_RECOMPRESS(55)
1097 +#endif
1098 +
1099 +#ifdef DOSTORESTATE56
1100 +SHA1_RECOMPRESS(56)
1101 +#endif
1102 +
1103 +#ifdef DOSTORESTATE57
1104 +SHA1_RECOMPRESS(57)
1105 +#endif
1106 +
1107 +#ifdef DOSTORESTATE58
1108 +SHA1_RECOMPRESS(58)
1109 +#endif
1110 +
1111 +#ifdef DOSTORESTATE59
1112 +SHA1_RECOMPRESS(59)
1113 +#endif
1114 +
1115 +#ifdef DOSTORESTATE60
1116 +SHA1_RECOMPRESS(60)
1117 +#endif
1118 +
1119 +#ifdef DOSTORESTATE61
1120 +SHA1_RECOMPRESS(61)
1121 +#endif
1122 +
1123 +#ifdef DOSTORESTATE62
1124 +SHA1_RECOMPRESS(62)
1125 +#endif
1126 +
1127 +#ifdef DOSTORESTATE63
1128 +SHA1_RECOMPRESS(63)
1129 +#endif
1130 +
1131 +#ifdef DOSTORESTATE64
1132 +SHA1_RECOMPRESS(64)
1133 +#endif
1134 +
1135 +#ifdef DOSTORESTATE65
1136 +SHA1_RECOMPRESS(65)
1137 +#endif
1138 +
1139 +#ifdef DOSTORESTATE66
1140 +SHA1_RECOMPRESS(66)
1141 +#endif
1142 +
1143 +#ifdef DOSTORESTATE67
1144 +SHA1_RECOMPRESS(67)
1145 +#endif
1146 +
1147 +#ifdef DOSTORESTATE68
1148 +SHA1_RECOMPRESS(68)
1149 +#endif
1150 +
1151 +#ifdef DOSTORESTATE69
1152 +SHA1_RECOMPRESS(69)
1153 +#endif
1154 +
1155 +#ifdef DOSTORESTATE70
1156 +SHA1_RECOMPRESS(70)
1157 +#endif
1158 +
1159 +#ifdef DOSTORESTATE71
1160 +SHA1_RECOMPRESS(71)
1161 +#endif
1162 +
1163 +#ifdef DOSTORESTATE72
1164 +SHA1_RECOMPRESS(72)
1165 +#endif
1166 +
1167 +#ifdef DOSTORESTATE73
1168 +SHA1_RECOMPRESS(73)
1169 +#endif
1170 +
1171 +#ifdef DOSTORESTATE74
1172 +SHA1_RECOMPRESS(74)
1173 +#endif
1174 +
1175 +#ifdef DOSTORESTATE75
1176 +SHA1_RECOMPRESS(75)
1177 +#endif
1178 +
1179 +#ifdef DOSTORESTATE76
1180 +SHA1_RECOMPRESS(76)
1181 +#endif
1182 +
1183 +#ifdef DOSTORESTATE77
1184 +SHA1_RECOMPRESS(77)
1185 +#endif
1186 +
1187 +#ifdef DOSTORESTATE78
1188 +SHA1_RECOMPRESS(78)
1189 +#endif
1190 +
1191 +#ifdef DOSTORESTATE79
1192 +SHA1_RECOMPRESS(79)
1193 +#endif
1194 +
1195 +static void sha1_recompression_step(uint32_t step, uint32_t ihvin[5], uint32_t ihvout[5], const uint32_t me2[80], const uint32_t state[5])
1196 +{
1197 + switch (step)
1198 + {
1199 +#ifdef DOSTORESTATE0
1200 + case 0:
1201 + sha1recompress_fast_0(ihvin, ihvout, me2, state);
1202 + break;
1203 +#endif
1204 +#ifdef DOSTORESTATE1
1205 + case 1:
1206 + sha1recompress_fast_1(ihvin, ihvout, me2, state);
1207 + break;
1208 +#endif
1209 +#ifdef DOSTORESTATE2
1210 + case 2:
1211 + sha1recompress_fast_2(ihvin, ihvout, me2, state);
1212 + break;
1213 +#endif
1214 +#ifdef DOSTORESTATE3
1215 + case 3:
1216 + sha1recompress_fast_3(ihvin, ihvout, me2, state);
1217 + break;
1218 +#endif
1219 +#ifdef DOSTORESTATE4
1220 + case 4:
1221 + sha1recompress_fast_4(ihvin, ihvout, me2, state);
1222 + break;
1223 +#endif
1224 +#ifdef DOSTORESTATE5
1225 + case 5:
1226 + sha1recompress_fast_5(ihvin, ihvout, me2, state);
1227 + break;
1228 +#endif
1229 +#ifdef DOSTORESTATE6
1230 + case 6:
1231 + sha1recompress_fast_6(ihvin, ihvout, me2, state);
1232 + break;
1233 +#endif
1234 +#ifdef DOSTORESTATE7
1235 + case 7:
1236 + sha1recompress_fast_7(ihvin, ihvout, me2, state);
1237 + break;
1238 +#endif
1239 +#ifdef DOSTORESTATE8
1240 + case 8:
1241 + sha1recompress_fast_8(ihvin, ihvout, me2, state);
1242 + break;
1243 +#endif
1244 +#ifdef DOSTORESTATE9
1245 + case 9:
1246 + sha1recompress_fast_9(ihvin, ihvout, me2, state);
1247 + break;
1248 +#endif
1249 +#ifdef DOSTORESTATE10
1250 + case 10:
1251 + sha1recompress_fast_10(ihvin, ihvout, me2, state);
1252 + break;
1253 +#endif
1254 +#ifdef DOSTORESTATE11
1255 + case 11:
1256 + sha1recompress_fast_11(ihvin, ihvout, me2, state);
1257 + break;
1258 +#endif
1259 +#ifdef DOSTORESTATE12
1260 + case 12:
1261 + sha1recompress_fast_12(ihvin, ihvout, me2, state);
1262 + break;
1263 +#endif
1264 +#ifdef DOSTORESTATE13
1265 + case 13:
1266 + sha1recompress_fast_13(ihvin, ihvout, me2, state);
1267 + break;
1268 +#endif
1269 +#ifdef DOSTORESTATE14
1270 + case 14:
1271 + sha1recompress_fast_14(ihvin, ihvout, me2, state);
1272 + break;
1273 +#endif
1274 +#ifdef DOSTORESTATE15
1275 + case 15:
1276 + sha1recompress_fast_15(ihvin, ihvout, me2, state);
1277 + break;
1278 +#endif
1279 +#ifdef DOSTORESTATE16
1280 + case 16:
1281 + sha1recompress_fast_16(ihvin, ihvout, me2, state);
1282 + break;
1283 +#endif
1284 +#ifdef DOSTORESTATE17
1285 + case 17:
1286 + sha1recompress_fast_17(ihvin, ihvout, me2, state);
1287 + break;
1288 +#endif
1289 +#ifdef DOSTORESTATE18
1290 + case 18:
1291 + sha1recompress_fast_18(ihvin, ihvout, me2, state);
1292 + break;
1293 +#endif
1294 +#ifdef DOSTORESTATE19
1295 + case 19:
1296 + sha1recompress_fast_19(ihvin, ihvout, me2, state);
1297 + break;
1298 +#endif
1299 +#ifdef DOSTORESTATE20
1300 + case 20:
1301 + sha1recompress_fast_20(ihvin, ihvout, me2, state);
1302 + break;
1303 +#endif
1304 +#ifdef DOSTORESTATE21
1305 + case 21:
1306 + sha1recompress_fast_21(ihvin, ihvout, me2, state);
1307 + break;
1308 +#endif
1309 +#ifdef DOSTORESTATE22
1310 + case 22:
1311 + sha1recompress_fast_22(ihvin, ihvout, me2, state);
1312 + break;
1313 +#endif
1314 +#ifdef DOSTORESTATE23
1315 + case 23:
1316 + sha1recompress_fast_23(ihvin, ihvout, me2, state);
1317 + break;
1318 +#endif
1319 +#ifdef DOSTORESTATE24
1320 + case 24:
1321 + sha1recompress_fast_24(ihvin, ihvout, me2, state);
1322 + break;
1323 +#endif
1324 +#ifdef DOSTORESTATE25
1325 + case 25:
1326 + sha1recompress_fast_25(ihvin, ihvout, me2, state);
1327 + break;
1328 +#endif
1329 +#ifdef DOSTORESTATE26
1330 + case 26:
1331 + sha1recompress_fast_26(ihvin, ihvout, me2, state);
1332 + break;
1333 +#endif
1334 +#ifdef DOSTORESTATE27
1335 + case 27:
1336 + sha1recompress_fast_27(ihvin, ihvout, me2, state);
1337 + break;
1338 +#endif
1339 +#ifdef DOSTORESTATE28
1340 + case 28:
1341 + sha1recompress_fast_28(ihvin, ihvout, me2, state);
1342 + break;
1343 +#endif
1344 +#ifdef DOSTORESTATE29
1345 + case 29:
1346 + sha1recompress_fast_29(ihvin, ihvout, me2, state);
1347 + break;
1348 +#endif
1349 +#ifdef DOSTORESTATE30
1350 + case 30:
1351 + sha1recompress_fast_30(ihvin, ihvout, me2, state);
1352 + break;
1353 +#endif
1354 +#ifdef DOSTORESTATE31
1355 + case 31:
1356 + sha1recompress_fast_31(ihvin, ihvout, me2, state);
1357 + break;
1358 +#endif
1359 +#ifdef DOSTORESTATE32
1360 + case 32:
1361 + sha1recompress_fast_32(ihvin, ihvout, me2, state);
1362 + break;
1363 +#endif
1364 +#ifdef DOSTORESTATE33
1365 + case 33:
1366 + sha1recompress_fast_33(ihvin, ihvout, me2, state);
1367 + break;
1368 +#endif
1369 +#ifdef DOSTORESTATE34
1370 + case 34:
1371 + sha1recompress_fast_34(ihvin, ihvout, me2, state);
1372 + break;
1373 +#endif
1374 +#ifdef DOSTORESTATE35
1375 + case 35:
1376 + sha1recompress_fast_35(ihvin, ihvout, me2, state);
1377 + break;
1378 +#endif
1379 +#ifdef DOSTORESTATE36
1380 + case 36:
1381 + sha1recompress_fast_36(ihvin, ihvout, me2, state);
1382 + break;
1383 +#endif
1384 +#ifdef DOSTORESTATE37
1385 + case 37:
1386 + sha1recompress_fast_37(ihvin, ihvout, me2, state);
1387 + break;
1388 +#endif
1389 +#ifdef DOSTORESTATE38
1390 + case 38:
1391 + sha1recompress_fast_38(ihvin, ihvout, me2, state);
1392 + break;
1393 +#endif
1394 +#ifdef DOSTORESTATE39
1395 + case 39:
1396 + sha1recompress_fast_39(ihvin, ihvout, me2, state);
1397 + break;
1398 +#endif
1399 +#ifdef DOSTORESTATE40
1400 + case 40:
1401 + sha1recompress_fast_40(ihvin, ihvout, me2, state);
1402 + break;
1403 +#endif
1404 +#ifdef DOSTORESTATE41
1405 + case 41:
1406 + sha1recompress_fast_41(ihvin, ihvout, me2, state);
1407 + break;
1408 +#endif
1409 +#ifdef DOSTORESTATE42
1410 + case 42:
1411 + sha1recompress_fast_42(ihvin, ihvout, me2, state);
1412 + break;
1413 +#endif
1414 +#ifdef DOSTORESTATE43
1415 + case 43:
1416 + sha1recompress_fast_43(ihvin, ihvout, me2, state);
1417 + break;
1418 +#endif
1419 +#ifdef DOSTORESTATE44
1420 + case 44:
1421 + sha1recompress_fast_44(ihvin, ihvout, me2, state);
1422 + break;
1423 +#endif
1424 +#ifdef DOSTORESTATE45
1425 + case 45:
1426 + sha1recompress_fast_45(ihvin, ihvout, me2, state);
1427 + break;
1428 +#endif
1429 +#ifdef DOSTORESTATE46
1430 + case 46:
1431 + sha1recompress_fast_46(ihvin, ihvout, me2, state);
1432 + break;
1433 +#endif
1434 +#ifdef DOSTORESTATE47
1435 + case 47:
1436 + sha1recompress_fast_47(ihvin, ihvout, me2, state);
1437 + break;
1438 +#endif
1439 +#ifdef DOSTORESTATE48
1440 + case 48:
1441 + sha1recompress_fast_48(ihvin, ihvout, me2, state);
1442 + break;
1443 +#endif
1444 +#ifdef DOSTORESTATE49
1445 + case 49:
1446 + sha1recompress_fast_49(ihvin, ihvout, me2, state);
1447 + break;
1448 +#endif
1449 +#ifdef DOSTORESTATE50
1450 + case 50:
1451 + sha1recompress_fast_50(ihvin, ihvout, me2, state);
1452 + break;
1453 +#endif
1454 +#ifdef DOSTORESTATE51
1455 + case 51:
1456 + sha1recompress_fast_51(ihvin, ihvout, me2, state);
1457 + break;
1458 +#endif
1459 +#ifdef DOSTORESTATE52
1460 + case 52:
1461 + sha1recompress_fast_52(ihvin, ihvout, me2, state);
1462 + break;
1463 +#endif
1464 +#ifdef DOSTORESTATE53
1465 + case 53:
1466 + sha1recompress_fast_53(ihvin, ihvout, me2, state);
1467 + break;
1468 +#endif
1469 +#ifdef DOSTORESTATE54
1470 + case 54:
1471 + sha1recompress_fast_54(ihvin, ihvout, me2, state);
1472 + break;
1473 +#endif
1474 +#ifdef DOSTORESTATE55
1475 + case 55:
1476 + sha1recompress_fast_55(ihvin, ihvout, me2, state);
1477 + break;
1478 +#endif
1479 +#ifdef DOSTORESTATE56
1480 + case 56:
1481 + sha1recompress_fast_56(ihvin, ihvout, me2, state);
1482 + break;
1483 +#endif
1484 +#ifdef DOSTORESTATE57
1485 + case 57:
1486 + sha1recompress_fast_57(ihvin, ihvout, me2, state);
1487 + break;
1488 +#endif
1489 +#ifdef DOSTORESTATE58
1490 + case 58:
1491 + sha1recompress_fast_58(ihvin, ihvout, me2, state);
1492 + break;
1493 +#endif
1494 +#ifdef DOSTORESTATE59
1495 + case 59:
1496 + sha1recompress_fast_59(ihvin, ihvout, me2, state);
1497 + break;
1498 +#endif
1499 +#ifdef DOSTORESTATE60
1500 + case 60:
1501 + sha1recompress_fast_60(ihvin, ihvout, me2, state);
1502 + break;
1503 +#endif
1504 +#ifdef DOSTORESTATE61
1505 + case 61:
1506 + sha1recompress_fast_61(ihvin, ihvout, me2, state);
1507 + break;
1508 +#endif
1509 +#ifdef DOSTORESTATE62
1510 + case 62:
1511 + sha1recompress_fast_62(ihvin, ihvout, me2, state);
1512 + break;
1513 +#endif
1514 +#ifdef DOSTORESTATE63
1515 + case 63:
1516 + sha1recompress_fast_63(ihvin, ihvout, me2, state);
1517 + break;
1518 +#endif
1519 +#ifdef DOSTORESTATE64
1520 + case 64:
1521 + sha1recompress_fast_64(ihvin, ihvout, me2, state);
1522 + break;
1523 +#endif
1524 +#ifdef DOSTORESTATE65
1525 + case 65:
1526 + sha1recompress_fast_65(ihvin, ihvout, me2, state);
1527 + break;
1528 +#endif
1529 +#ifdef DOSTORESTATE66
1530 + case 66:
1531 + sha1recompress_fast_66(ihvin, ihvout, me2, state);
1532 + break;
1533 +#endif
1534 +#ifdef DOSTORESTATE67
1535 + case 67:
1536 + sha1recompress_fast_67(ihvin, ihvout, me2, state);
1537 + break;
1538 +#endif
1539 +#ifdef DOSTORESTATE68
1540 + case 68:
1541 + sha1recompress_fast_68(ihvin, ihvout, me2, state);
1542 + break;
1543 +#endif
1544 +#ifdef DOSTORESTATE69
1545 + case 69:
1546 + sha1recompress_fast_69(ihvin, ihvout, me2, state);
1547 + break;
1548 +#endif
1549 +#ifdef DOSTORESTATE70
1550 + case 70:
1551 + sha1recompress_fast_70(ihvin, ihvout, me2, state);
1552 + break;
1553 +#endif
1554 +#ifdef DOSTORESTATE71
1555 + case 71:
1556 + sha1recompress_fast_71(ihvin, ihvout, me2, state);
1557 + break;
1558 +#endif
1559 +#ifdef DOSTORESTATE72
1560 + case 72:
1561 + sha1recompress_fast_72(ihvin, ihvout, me2, state);
1562 + break;
1563 +#endif
1564 +#ifdef DOSTORESTATE73
1565 + case 73:
1566 + sha1recompress_fast_73(ihvin, ihvout, me2, state);
1567 + break;
1568 +#endif
1569 +#ifdef DOSTORESTATE74
1570 + case 74:
1571 + sha1recompress_fast_74(ihvin, ihvout, me2, state);
1572 + break;
1573 +#endif
1574 +#ifdef DOSTORESTATE75
1575 + case 75:
1576 + sha1recompress_fast_75(ihvin, ihvout, me2, state);
1577 + break;
1578 +#endif
1579 +#ifdef DOSTORESTATE76
1580 + case 76:
1581 + sha1recompress_fast_76(ihvin, ihvout, me2, state);
1582 + break;
1583 +#endif
1584 +#ifdef DOSTORESTATE77
1585 + case 77:
1586 + sha1recompress_fast_77(ihvin, ihvout, me2, state);
1587 + break;
1588 +#endif
1589 +#ifdef DOSTORESTATE78
1590 + case 78:
1591 + sha1recompress_fast_78(ihvin, ihvout, me2, state);
1592 + break;
1593 +#endif
1594 +#ifdef DOSTORESTATE79
1595 + case 79:
1596 + sha1recompress_fast_79(ihvin, ihvout, me2, state);
1597 + break;
1598 +#endif
1599 + default:
1600 + abort();
1601 + }
1602 +
1603 +}
1604 +
1605 +
1606 +
1607 +static void sha1_process(SHA1_CTX* ctx, const uint32_t block[16])
1608 +{
1609 + unsigned i, j;
1610 + uint32_t ubc_dv_mask[DVMASKSIZE] = { 0xFFFFFFFF };
1611 + uint32_t ihvtmp[5];
1612 +
1613 + ctx->ihv1[0] = ctx->ihv[0];
1614 + ctx->ihv1[1] = ctx->ihv[1];
1615 + ctx->ihv1[2] = ctx->ihv[2];
1616 + ctx->ihv1[3] = ctx->ihv[3];
1617 + ctx->ihv1[4] = ctx->ihv[4];
1618 +
1619 + sha1_compression_states(ctx->ihv, block, ctx->m1, ctx->states);
1620 +
1621 + if (ctx->detect_coll)
1622 + {
1623 + if (ctx->ubc_check)
1624 + {
1625 + ubc_check(ctx->m1, ubc_dv_mask);
1626 + }
1627 +
1628 + if (ubc_dv_mask[0] != 0)
1629 + {
1630 + for (i = 0; sha1_dvs[i].dvType != 0; ++i)
1631 + {
1632 + if (ubc_dv_mask[0] & ((uint32_t)(1) << sha1_dvs[i].maskb))
1633 + {
1634 + for (j = 0; j < 80; ++j)
1635 + ctx->m2[j] = ctx->m1[j] ^ sha1_dvs[i].dm[j];
1636 +
1637 + sha1_recompression_step(sha1_dvs[i].testt, ctx->ihv2, ihvtmp, ctx->m2, ctx->states[sha1_dvs[i].testt]);
1638 +
1639 + /* to verify SHA-1 collision detection code with collisions for reduced-step SHA-1 */
1640 + if ((0 == ((ihvtmp[0] ^ ctx->ihv[0]) | (ihvtmp[1] ^ ctx->ihv[1]) | (ihvtmp[2] ^ ctx->ihv[2]) | (ihvtmp[3] ^ ctx->ihv[3]) | (ihvtmp[4] ^ ctx->ihv[4])))
1641 + || (ctx->reduced_round_coll && 0==((ctx->ihv1[0] ^ ctx->ihv2[0]) | (ctx->ihv1[1] ^ ctx->ihv2[1]) | (ctx->ihv1[2] ^ ctx->ihv2[2]) | (ctx->ihv1[3] ^ ctx->ihv2[3]) | (ctx->ihv1[4] ^ ctx->ihv2[4]))))
1642 + {
1643 + ctx->found_collision = 1;
1644 +
1645 + if (ctx->safe_hash)
1646 + {
1647 + sha1_compression_W(ctx->ihv, ctx->m1);
1648 + sha1_compression_W(ctx->ihv, ctx->m1);
1649 + }
1650 +
1651 + break;
1652 + }
1653 + }
1654 + }
1655 + }
1656 + }
1657 +}
1658 +
1659 +void SHA1DCInit(SHA1_CTX* ctx)
1660 +{
1661 + ctx->total = 0;
1662 + ctx->ihv[0] = 0x67452301;
1663 + ctx->ihv[1] = 0xEFCDAB89;
1664 + ctx->ihv[2] = 0x98BADCFE;
1665 + ctx->ihv[3] = 0x10325476;
1666 + ctx->ihv[4] = 0xC3D2E1F0;
1667 + ctx->found_collision = 0;
1668 + ctx->safe_hash = 1;
1669 + ctx->ubc_check = 1;
1670 + ctx->detect_coll = 1;
1671 + ctx->reduced_round_coll = 0;
1672 + ctx->callback = NULL;
1673 +}
1674 +
1675 +void SHA1DCSetSafeHash(SHA1_CTX* ctx, int safehash)
1676 +{
1677 + if (safehash)
1678 + ctx->safe_hash = 1;
1679 + else
1680 + ctx->safe_hash = 0;
1681 +}
1682 +
1683 +
1684 +void SHA1DCSetUseUBC(SHA1_CTX* ctx, int ubc_check)
1685 +{
1686 + if (ubc_check)
1687 + ctx->ubc_check = 1;
1688 + else
1689 + ctx->ubc_check = 0;
1690 +}
1691 +
1692 +void SHA1DCSetUseDetectColl(SHA1_CTX* ctx, int detect_coll)
1693 +{
1694 + if (detect_coll)
1695 + ctx->detect_coll = 1;
1696 + else
1697 + ctx->detect_coll = 0;
1698 +}
1699 +
1700 +void SHA1DCSetDetectReducedRoundCollision(SHA1_CTX* ctx, int reduced_round_coll)
1701 +{
1702 + if (reduced_round_coll)
1703 + ctx->reduced_round_coll = 1;
1704 + else
1705 + ctx->reduced_round_coll = 0;
1706 +}
1707 +
1708 +void SHA1DCSetCallback(SHA1_CTX* ctx, collision_block_callback callback)
1709 +{
1710 + ctx->callback = callback;
1711 +}
1712 +
1713 +void SHA1DCUpdate(SHA1_CTX* ctx, const char* buf, size_t len)
1714 +{
1715 + unsigned left, fill;
1716 + if (len == 0)
1717 + return;
1718 +
1719 + left = ctx->total & 63;
1720 + fill = 64 - left;
1721 +
1722 + if (left && len >= fill)
1723 + {
1724 + ctx->total += fill;
1725 + memcpy(ctx->buffer + left, buf, fill);
1726 + sha1_process(ctx, (uint32_t*)(ctx->buffer));
1727 + buf += fill;
1728 + len -= fill;
1729 + left = 0;
1730 + }
1731 + while (len >= 64)
1732 + {
1733 + ctx->total += 64;
1734 + sha1_process(ctx, (uint32_t*)(buf));
1735 + buf += 64;
1736 + len -= 64;
1737 + }
1738 + if (len > 0)
1739 + {
1740 + ctx->total += len;
1741 + memcpy(ctx->buffer + left, buf, len);
1742 + }
1743 +}
1744 +
1745 +static const unsigned char sha1_padding[64] =
1746 +{
1747 + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1748 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1749 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1750 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1751 +};
1752 +
1753 +int SHA1DCFinal(unsigned char output[20], SHA1_CTX *ctx)
1754 +{
1755 + uint32_t last = ctx->total & 63;
1756 + uint32_t padn = (last < 56) ? (56 - last) : (120 - last);
1757 + uint64_t total;
1758 + SHA1DCUpdate(ctx, (const char*)(sha1_padding), padn);
1759 +
1760 + total = ctx->total - padn;
1761 + total <<= 3;
1762 + ctx->buffer[56] = (unsigned char)(total >> 56);
1763 + ctx->buffer[57] = (unsigned char)(total >> 48);
1764 + ctx->buffer[58] = (unsigned char)(total >> 40);
1765 + ctx->buffer[59] = (unsigned char)(total >> 32);
1766 + ctx->buffer[60] = (unsigned char)(total >> 24);
1767 + ctx->buffer[61] = (unsigned char)(total >> 16);
1768 + ctx->buffer[62] = (unsigned char)(total >> 8);
1769 + ctx->buffer[63] = (unsigned char)(total);
1770 + sha1_process(ctx, (uint32_t*)(ctx->buffer));
1771 + output[0] = (unsigned char)(ctx->ihv[0] >> 24);
1772 + output[1] = (unsigned char)(ctx->ihv[0] >> 16);
1773 + output[2] = (unsigned char)(ctx->ihv[0] >> 8);
1774 + output[3] = (unsigned char)(ctx->ihv[0]);
1775 + output[4] = (unsigned char)(ctx->ihv[1] >> 24);
1776 + output[5] = (unsigned char)(ctx->ihv[1] >> 16);
1777 + output[6] = (unsigned char)(ctx->ihv[1] >> 8);
1778 + output[7] = (unsigned char)(ctx->ihv[1]);
1779 + output[8] = (unsigned char)(ctx->ihv[2] >> 24);
1780 + output[9] = (unsigned char)(ctx->ihv[2] >> 16);
1781 + output[10] = (unsigned char)(ctx->ihv[2] >> 8);
1782 + output[11] = (unsigned char)(ctx->ihv[2]);
1783 + output[12] = (unsigned char)(ctx->ihv[3] >> 24);
1784 + output[13] = (unsigned char)(ctx->ihv[3] >> 16);
1785 + output[14] = (unsigned char)(ctx->ihv[3] >> 8);
1786 + output[15] = (unsigned char)(ctx->ihv[3]);
1787 + output[16] = (unsigned char)(ctx->ihv[4] >> 24);
1788 + output[17] = (unsigned char)(ctx->ihv[4] >> 16);
1789 + output[18] = (unsigned char)(ctx->ihv[4] >> 8);
1790 + output[19] = (unsigned char)(ctx->ihv[4]);
1791 + return ctx->found_collision;
1792 +}
sha1dc/sha1.h new
+105
@@ -0,0 +1,105 @@
1 +/***
2 +* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
3 +* Distributed under the MIT Software License.
4 +* See accompanying file LICENSE.txt or copy at
5 +* https://opensource.org/licenses/MIT
6 +***/
7 +
8 +#if defined(__cplusplus)
9 +extern "C" {
10 +#endif
11 +
12 +#include <stdint.h>
13 +
14 +/* uses SHA-1 message expansion to expand the first 16 words of W[] to 80 words */
15 +/* void sha1_message_expansion(uint32_t W[80]); */
16 +
17 +/* sha-1 compression function; first version takes a message block pre-parsed as 16 32-bit integers, second version takes an already expanded message) */
18 +/* void sha1_compression(uint32_t ihv[5], const uint32_t m[16]);
19 +void sha1_compression_W(uint32_t ihv[5], const uint32_t W[80]); */
20 +
21 +/* same as sha1_compression_W, but additionally store intermediate states */
22 +/* only stores states ii (the state between step ii-1 and step ii) when DOSTORESTATEii is defined in ubc_check.h */
23 +void sha1_compression_states(uint32_t[5], const uint32_t[16], uint32_t[80], uint32_t[80][5]);
24 +
25 +/*
26 +// function type for sha1_recompression_step_T (uint32_t ihvin[5], uint32_t ihvout[5], const uint32_t me2[80], const uint32_t state[5])
27 +// where 0 <= T < 80
28 +// me2 is an expanded message (the expansion of an original message block XOR'ed with a disturbance vector's message block difference)
29 +// state is the internal state (a,b,c,d,e) before step T of the SHA-1 compression function while processing the original message block
30 +// the function will return:
31 +// ihvin: the reconstructed input chaining value
32 +// ihvout: the reconstructed output chaining value
33 +*/
34 +typedef void(*sha1_recompression_type)(uint32_t*, uint32_t*, const uint32_t*, const uint32_t*);
35 +
36 +/* table of sha1_recompression_step_0, ... , sha1_recompression_step_79 */
37 +/* extern sha1_recompression_type sha1_recompression_step[80];*/
38 +
39 +/* a callback function type that can be set to be called when a collision block has been found: */
40 +/* void collision_block_callback(uint64_t byteoffset, const uint32_t ihvin1[5], const uint32_t ihvin2[5], const uint32_t m1[80], const uint32_t m2[80]) */
41 +typedef void(*collision_block_callback)(uint64_t, const uint32_t*, const uint32_t*, const uint32_t*, const uint32_t*);
42 +
43 +/* the SHA-1 context */
44 +typedef struct {
45 + uint64_t total;
46 + uint32_t ihv[5];
47 + unsigned char buffer[64];
48 + int found_collision;
49 + int safe_hash;
50 + int detect_coll;
51 + int ubc_check;
52 + int reduced_round_coll;
53 + collision_block_callback callback;
54 +
55 + uint32_t ihv1[5];
56 + uint32_t ihv2[5];
57 + uint32_t m1[80];
58 + uint32_t m2[80];
59 + uint32_t states[80][5];
60 +} SHA1_CTX;
61 +
62 +/* initialize SHA-1 context */
63 +void SHA1DCInit(SHA1_CTX*);
64 +
65 +/*
66 +// function to enable safe SHA-1 hashing:
67 +// collision attacks are thwarted by hashing a detected near-collision block 3 times
68 +// think of it as extending SHA-1 from 80-steps to 240-steps for such blocks:
69 +// the best collision attacks against SHA-1 have complexity about 2^60,
70 +// thus for 240-steps an immediate lower-bound for the best cryptanalytic attacks would 2^180
71 +// an attacker would be better off using a generic birthday search of complexity 2^80
72 +//
73 +// enabling safe SHA-1 hashing will result in the correct SHA-1 hash for messages where no collision attack was detected
74 +// but it will result in a different SHA-1 hash for messages where a collision attack was detected
75 +// this will automatically invalidate SHA-1 based digital signature forgeries
76 +// enabled by default
77 +*/
78 +void SHA1DCSetSafeHash(SHA1_CTX*, int);
79 +
80 +/* function to disable or enable the use of Unavoidable Bitconditions (provides a significant speed up) */
81 +/* enabled by default */
82 +void SHA1DCSetUseUBC(SHA1_CTX*, int);
83 +
84 +/* function to disable or enable the use of Collision Detection */
85 +/* enabled by default */
86 +void SHA1DCSetUseDetectColl(SHA1_CTX*, int);
87 +
88 +/* function to disable or enable the detection of reduced-round SHA-1 collisions */
89 +/* disabled by default */
90 +void SHA1DCSetDetectReducedRoundCollision(SHA1_CTX*, int);
91 +
92 +/* function to set a callback function, pass NULL to disable */
93 +/* by default no callback set */
94 +void SHA1DCSetCallback(SHA1_CTX*, collision_block_callback);
95 +
96 +/* update SHA-1 context with buffer contents */
97 +void SHA1DCUpdate(SHA1_CTX*, const char*, size_t);
98 +
99 +/* obtain SHA-1 hash from SHA-1 context */
100 +/* returns: 0 = no collision detected, otherwise = collision found => warn user for active attack */
101 +int SHA1DCFinal(unsigned char[20], SHA1_CTX*);
102 +
103 +#if defined(__cplusplus)
104 +}
105 +#endif
sha1dc/ubc_check.c new
+363
@@ -0,0 +1,363 @@
1 +/***
2 +* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
3 +* Distributed under the MIT Software License.
4 +* See accompanying file LICENSE.txt or copy at
5 +* https://opensource.org/licenses/MIT
6 +***/
7 +
8 +/*
9 +// this file was generated by the 'parse_bitrel' program in the tools section
10 +// using the data files from directory 'tools/data/3565'
11 +//
12 +// sha1_dvs contains a list of SHA-1 Disturbance Vectors (DV) to check
13 +// dvType, dvK and dvB define the DV: I(K,B) or II(K,B) (see the paper)
14 +// dm[80] is the expanded message block XOR-difference defined by the DV
15 +// testt is the step to do the recompression from for collision detection
16 +// maski and maskb define the bit to check for each DV in the dvmask returned by ubc_check
17 +//
18 +// ubc_check takes as input an expanded message block and verifies the unavoidable bitconditions for all listed DVs
19 +// it returns a dvmask where each bit belonging to a DV is set if all unavoidable bitconditions for that DV have been met
20 +// thus one needs to do the recompression check for each DV that has its bit set
21 +//
22 +// ubc_check is programmatically generated and the unavoidable bitconditions have been hardcoded
23 +// a directly verifiable version named ubc_check_verify can be found in ubc_check_verify.c
24 +// ubc_check has been verified against ubc_check_verify using the 'ubc_check_test' program in the tools section
25 +*/
26 +
27 +#include <stdint.h>
28 +#include "ubc_check.h"
29 +
30 +static const uint32_t DV_I_43_0_bit = (uint32_t)(1) << 0;
31 +static const uint32_t DV_I_44_0_bit = (uint32_t)(1) << 1;
32 +static const uint32_t DV_I_45_0_bit = (uint32_t)(1) << 2;
33 +static const uint32_t DV_I_46_0_bit = (uint32_t)(1) << 3;
34 +static const uint32_t DV_I_46_2_bit = (uint32_t)(1) << 4;
35 +static const uint32_t DV_I_47_0_bit = (uint32_t)(1) << 5;
36 +static const uint32_t DV_I_47_2_bit = (uint32_t)(1) << 6;
37 +static const uint32_t DV_I_48_0_bit = (uint32_t)(1) << 7;
38 +static const uint32_t DV_I_48_2_bit = (uint32_t)(1) << 8;
39 +static const uint32_t DV_I_49_0_bit = (uint32_t)(1) << 9;
40 +static const uint32_t DV_I_49_2_bit = (uint32_t)(1) << 10;
41 +static const uint32_t DV_I_50_0_bit = (uint32_t)(1) << 11;
42 +static const uint32_t DV_I_50_2_bit = (uint32_t)(1) << 12;
43 +static const uint32_t DV_I_51_0_bit = (uint32_t)(1) << 13;
44 +static const uint32_t DV_I_51_2_bit = (uint32_t)(1) << 14;
45 +static const uint32_t DV_I_52_0_bit = (uint32_t)(1) << 15;
46 +static const uint32_t DV_II_45_0_bit = (uint32_t)(1) << 16;
47 +static const uint32_t DV_II_46_0_bit = (uint32_t)(1) << 17;
48 +static const uint32_t DV_II_46_2_bit = (uint32_t)(1) << 18;
49 +static const uint32_t DV_II_47_0_bit = (uint32_t)(1) << 19;
50 +static const uint32_t DV_II_48_0_bit = (uint32_t)(1) << 20;
51 +static const uint32_t DV_II_49_0_bit = (uint32_t)(1) << 21;
52 +static const uint32_t DV_II_49_2_bit = (uint32_t)(1) << 22;
53 +static const uint32_t DV_II_50_0_bit = (uint32_t)(1) << 23;
54 +static const uint32_t DV_II_50_2_bit = (uint32_t)(1) << 24;
55 +static const uint32_t DV_II_51_0_bit = (uint32_t)(1) << 25;
56 +static const uint32_t DV_II_51_2_bit = (uint32_t)(1) << 26;
57 +static const uint32_t DV_II_52_0_bit = (uint32_t)(1) << 27;
58 +static const uint32_t DV_II_53_0_bit = (uint32_t)(1) << 28;
59 +static const uint32_t DV_II_54_0_bit = (uint32_t)(1) << 29;
60 +static const uint32_t DV_II_55_0_bit = (uint32_t)(1) << 30;
61 +static const uint32_t DV_II_56_0_bit = (uint32_t)(1) << 31;
62 +
63 +dv_info_t sha1_dvs[] =
64 +{
65 + {1,43,0,58,0,0, { 0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c,0x00000803,0x80000161,0x80000599 } }
66 +, {1,44,0,58,0,1, { 0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c,0x00000803,0x80000161 } }
67 +, {1,45,0,58,0,2, { 0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c,0x00000803 } }
68 +, {1,46,0,58,0,3, { 0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c } }
69 +, {1,46,2,58,0,4, { 0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590,0x00001020,0x0000039a,0x00000132 } }
70 +, {1,47,0,58,0,5, { 0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6 } }
71 +, {1,47,2,58,0,6, { 0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590,0x00001020,0x0000039a } }
72 +, {1,48,0,58,0,7, { 0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408 } }
73 +, {1,48,2,58,0,8, { 0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590,0x00001020 } }
74 +, {1,49,0,58,0,9, { 0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164 } }
75 +, {1,49,2,58,0,10, { 0x60000000,0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590 } }
76 +, {1,50,0,65,0,11, { 0x0800000c,0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018 } }
77 +, {1,50,2,65,0,12, { 0x20000030,0x60000000,0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060 } }
78 +, {1,51,0,65,0,13, { 0xe8000000,0x0800000c,0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202 } }
79 +, {1,51,2,65,0,14, { 0xa0000003,0x20000030,0x60000000,0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a } }
80 +, {1,52,0,65,0,15, { 0x04000010,0xe8000000,0x0800000c,0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012 } }
81 +, {2,45,0,58,0,16, { 0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a,0x000002e4,0x80000054,0x00000967 } }
82 +, {2,46,0,58,0,17, { 0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a,0x000002e4,0x80000054 } }
83 +, {2,46,2,58,0,18, { 0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e,0x0000046c,0x000005b6,0x0000106a,0x00000b90,0x00000152 } }
84 +, {2,47,0,58,0,19, { 0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a,0x000002e4 } }
85 +, {2,48,0,58,0,20, { 0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a } }
86 +, {2,49,0,58,0,21, { 0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d } }
87 +, {2,49,2,58,0,22, { 0xf0000010,0xf000006a,0x80000040,0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e,0x0000046c,0x000005b6 } }
88 +, {2,50,0,65,0,23, { 0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b } }
89 +, {2,50,2,65,0,24, { 0xd0000072,0xf0000010,0xf000006a,0x80000040,0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e,0x0000046c } }
90 +, {2,51,0,65,0,25, { 0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b } }
91 +, {2,51,2,65,0,26, { 0x00000043,0xd0000072,0xf0000010,0xf000006a,0x80000040,0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e } }
92 +, {2,52,0,65,0,27, { 0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014 } }
93 +, {2,53,0,65,0,28, { 0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089 } }
94 +, {2,54,0,65,0,29, { 0x0400001c,0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107 } }
95 +, {2,55,0,65,0,30, { 0x00000010,0x0400001c,0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b } }
96 +, {2,56,0,65,0,31, { 0x2600001a,0x00000010,0x0400001c,0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046 } }
97 +, {0,0,0,0,0,0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}
98 +};
99 +void ubc_check(const uint32_t W[80], uint32_t dvmask[1])
100 +{
101 + uint32_t mask = ~((uint32_t)(0));
102 + mask &= (((((W[44]^W[45])>>29)&1)-1) | ~(DV_I_48_0_bit|DV_I_51_0_bit|DV_I_52_0_bit|DV_II_45_0_bit|DV_II_46_0_bit|DV_II_50_0_bit|DV_II_51_0_bit));
103 + mask &= (((((W[49]^W[50])>>29)&1)-1) | ~(DV_I_46_0_bit|DV_II_45_0_bit|DV_II_50_0_bit|DV_II_51_0_bit|DV_II_55_0_bit|DV_II_56_0_bit));
104 + mask &= (((((W[48]^W[49])>>29)&1)-1) | ~(DV_I_45_0_bit|DV_I_52_0_bit|DV_II_49_0_bit|DV_II_50_0_bit|DV_II_54_0_bit|DV_II_55_0_bit));
105 + mask &= ((((W[47]^(W[50]>>25))&(1<<4))-(1<<4)) | ~(DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_51_0_bit|DV_II_56_0_bit));
106 + mask &= (((((W[47]^W[48])>>29)&1)-1) | ~(DV_I_44_0_bit|DV_I_51_0_bit|DV_II_48_0_bit|DV_II_49_0_bit|DV_II_53_0_bit|DV_II_54_0_bit));
107 + mask &= (((((W[46]>>4)^(W[49]>>29))&1)-1) | ~(DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit|DV_II_50_0_bit|DV_II_55_0_bit));
108 + mask &= (((((W[46]^W[47])>>29)&1)-1) | ~(DV_I_43_0_bit|DV_I_50_0_bit|DV_II_47_0_bit|DV_II_48_0_bit|DV_II_52_0_bit|DV_II_53_0_bit));
109 + mask &= (((((W[45]>>4)^(W[48]>>29))&1)-1) | ~(DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit|DV_II_49_0_bit|DV_II_54_0_bit));
110 + mask &= (((((W[45]^W[46])>>29)&1)-1) | ~(DV_I_49_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_47_0_bit|DV_II_51_0_bit|DV_II_52_0_bit));
111 + mask &= (((((W[44]>>4)^(W[47]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit|DV_II_48_0_bit|DV_II_53_0_bit));
112 + mask &= (((((W[43]>>4)^(W[46]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit|DV_II_47_0_bit|DV_II_52_0_bit));
113 + mask &= (((((W[43]^W[44])>>29)&1)-1) | ~(DV_I_47_0_bit|DV_I_50_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_49_0_bit|DV_II_50_0_bit));
114 + mask &= (((((W[42]>>4)^(W[45]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_51_0_bit));
115 + mask &= (((((W[41]>>4)^(W[44]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_50_0_bit));
116 + mask &= (((((W[40]^W[41])>>29)&1)-1) | ~(DV_I_44_0_bit|DV_I_47_0_bit|DV_I_48_0_bit|DV_II_46_0_bit|DV_II_47_0_bit|DV_II_56_0_bit));
117 + mask &= (((((W[54]^W[55])>>29)&1)-1) | ~(DV_I_51_0_bit|DV_II_47_0_bit|DV_II_50_0_bit|DV_II_55_0_bit|DV_II_56_0_bit));
118 + mask &= (((((W[53]^W[54])>>29)&1)-1) | ~(DV_I_50_0_bit|DV_II_46_0_bit|DV_II_49_0_bit|DV_II_54_0_bit|DV_II_55_0_bit));
119 + mask &= (((((W[52]^W[53])>>29)&1)-1) | ~(DV_I_49_0_bit|DV_II_45_0_bit|DV_II_48_0_bit|DV_II_53_0_bit|DV_II_54_0_bit));
120 + mask &= ((((W[50]^(W[53]>>25))&(1<<4))-(1<<4)) | ~(DV_I_50_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_48_0_bit|DV_II_54_0_bit));
121 + mask &= (((((W[50]^W[51])>>29)&1)-1) | ~(DV_I_47_0_bit|DV_II_46_0_bit|DV_II_51_0_bit|DV_II_52_0_bit|DV_II_56_0_bit));
122 + mask &= ((((W[49]^(W[52]>>25))&(1<<4))-(1<<4)) | ~(DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_47_0_bit|DV_II_53_0_bit));
123 + mask &= ((((W[48]^(W[51]>>25))&(1<<4))-(1<<4)) | ~(DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_52_0_bit));
124 + mask &= (((((W[42]^W[43])>>29)&1)-1) | ~(DV_I_46_0_bit|DV_I_49_0_bit|DV_I_50_0_bit|DV_II_48_0_bit|DV_II_49_0_bit));
125 + mask &= (((((W[41]^W[42])>>29)&1)-1) | ~(DV_I_45_0_bit|DV_I_48_0_bit|DV_I_49_0_bit|DV_II_47_0_bit|DV_II_48_0_bit));
126 + mask &= (((((W[40]>>4)^(W[43]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_50_0_bit|DV_II_49_0_bit|DV_II_56_0_bit));
127 + mask &= (((((W[39]>>4)^(W[42]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_49_0_bit|DV_II_48_0_bit|DV_II_55_0_bit));
128 + if (mask & (DV_I_44_0_bit|DV_I_48_0_bit|DV_II_47_0_bit|DV_II_54_0_bit|DV_II_56_0_bit))
129 + mask &= (((((W[38]>>4)^(W[41]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_48_0_bit|DV_II_47_0_bit|DV_II_54_0_bit|DV_II_56_0_bit));
130 + mask &= (((((W[37]>>4)^(W[40]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_47_0_bit|DV_II_46_0_bit|DV_II_53_0_bit|DV_II_55_0_bit));
131 + if (mask & (DV_I_52_0_bit|DV_II_48_0_bit|DV_II_51_0_bit|DV_II_56_0_bit))
132 + mask &= (((((W[55]^W[56])>>29)&1)-1) | ~(DV_I_52_0_bit|DV_II_48_0_bit|DV_II_51_0_bit|DV_II_56_0_bit));
133 + if (mask & (DV_I_52_0_bit|DV_II_48_0_bit|DV_II_50_0_bit|DV_II_56_0_bit))
134 + mask &= ((((W[52]^(W[55]>>25))&(1<<4))-(1<<4)) | ~(DV_I_52_0_bit|DV_II_48_0_bit|DV_II_50_0_bit|DV_II_56_0_bit));
135 + if (mask & (DV_I_51_0_bit|DV_II_47_0_bit|DV_II_49_0_bit|DV_II_55_0_bit))
136 + mask &= ((((W[51]^(W[54]>>25))&(1<<4))-(1<<4)) | ~(DV_I_51_0_bit|DV_II_47_0_bit|DV_II_49_0_bit|DV_II_55_0_bit));
137 + if (mask & (DV_I_48_0_bit|DV_II_47_0_bit|DV_II_52_0_bit|DV_II_53_0_bit))
138 + mask &= (((((W[51]^W[52])>>29)&1)-1) | ~(DV_I_48_0_bit|DV_II_47_0_bit|DV_II_52_0_bit|DV_II_53_0_bit));
139 + if (mask & (DV_I_46_0_bit|DV_I_49_0_bit|DV_II_45_0_bit|DV_II_48_0_bit))
140 + mask &= (((((W[36]>>4)^(W[40]>>29))&1)-1) | ~(DV_I_46_0_bit|DV_I_49_0_bit|DV_II_45_0_bit|DV_II_48_0_bit));
141 + if (mask & (DV_I_52_0_bit|DV_II_48_0_bit|DV_II_49_0_bit))
142 + mask &= ((0-(((W[53]^W[56])>>29)&1)) | ~(DV_I_52_0_bit|DV_II_48_0_bit|DV_II_49_0_bit));
143 + if (mask & (DV_I_50_0_bit|DV_II_46_0_bit|DV_II_47_0_bit))
144 + mask &= ((0-(((W[51]^W[54])>>29)&1)) | ~(DV_I_50_0_bit|DV_II_46_0_bit|DV_II_47_0_bit));
145 + if (mask & (DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit))
146 + mask &= ((0-(((W[50]^W[52])>>29)&1)) | ~(DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit));
147 + if (mask & (DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit))
148 + mask &= ((0-(((W[49]^W[51])>>29)&1)) | ~(DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit));
149 + if (mask & (DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit))
150 + mask &= ((0-(((W[48]^W[50])>>29)&1)) | ~(DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit));
151 + if (mask & (DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit))
152 + mask &= ((0-(((W[47]^W[49])>>29)&1)) | ~(DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit));
153 + if (mask & (DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit))
154 + mask &= ((0-(((W[46]^W[48])>>29)&1)) | ~(DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit));
155 + mask &= ((((W[45]^W[47])&(1<<6))-(1<<6)) | ~(DV_I_47_2_bit|DV_I_49_2_bit|DV_I_51_2_bit));
156 + if (mask & (DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit))
157 + mask &= ((0-(((W[45]^W[47])>>29)&1)) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit));
158 + mask &= (((((W[44]^W[46])>>6)&1)-1) | ~(DV_I_46_2_bit|DV_I_48_2_bit|DV_I_50_2_bit));
159 + if (mask & (DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit))
160 + mask &= ((0-(((W[44]^W[46])>>29)&1)) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit));
161 + mask &= ((0-((W[41]^(W[42]>>5))&(1<<1))) | ~(DV_I_48_2_bit|DV_II_46_2_bit|DV_II_51_2_bit));
162 + mask &= ((0-((W[40]^(W[41]>>5))&(1<<1))) | ~(DV_I_47_2_bit|DV_I_51_2_bit|DV_II_50_2_bit));
163 + if (mask & (DV_I_44_0_bit|DV_I_46_0_bit|DV_II_56_0_bit))
164 + mask &= ((0-(((W[40]^W[42])>>4)&1)) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_II_56_0_bit));
165 + mask &= ((0-((W[39]^(W[40]>>5))&(1<<1))) | ~(DV_I_46_2_bit|DV_I_50_2_bit|DV_II_49_2_bit));
166 + if (mask & (DV_I_43_0_bit|DV_I_45_0_bit|DV_II_55_0_bit))
167 + mask &= ((0-(((W[39]^W[41])>>4)&1)) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_II_55_0_bit));
168 + if (mask & (DV_I_44_0_bit|DV_II_54_0_bit|DV_II_56_0_bit))
169 + mask &= ((0-(((W[38]^W[40])>>4)&1)) | ~(DV_I_44_0_bit|DV_II_54_0_bit|DV_II_56_0_bit));
170 + if (mask & (DV_I_43_0_bit|DV_II_53_0_bit|DV_II_55_0_bit))
171 + mask &= ((0-(((W[37]^W[39])>>4)&1)) | ~(DV_I_43_0_bit|DV_II_53_0_bit|DV_II_55_0_bit));
172 + mask &= ((0-((W[36]^(W[37]>>5))&(1<<1))) | ~(DV_I_47_2_bit|DV_I_50_2_bit|DV_II_46_2_bit));
173 + if (mask & (DV_I_45_0_bit|DV_I_48_0_bit|DV_II_47_0_bit))
174 + mask &= (((((W[35]>>4)^(W[39]>>29))&1)-1) | ~(DV_I_45_0_bit|DV_I_48_0_bit|DV_II_47_0_bit));
175 + if (mask & (DV_I_48_0_bit|DV_II_48_0_bit))
176 + mask &= ((0-((W[63]^(W[64]>>5))&(1<<0))) | ~(DV_I_48_0_bit|DV_II_48_0_bit));
177 + if (mask & (DV_I_45_0_bit|DV_II_45_0_bit))
178 + mask &= ((0-((W[63]^(W[64]>>5))&(1<<1))) | ~(DV_I_45_0_bit|DV_II_45_0_bit));
179 + if (mask & (DV_I_47_0_bit|DV_II_47_0_bit))
180 + mask &= ((0-((W[62]^(W[63]>>5))&(1<<0))) | ~(DV_I_47_0_bit|DV_II_47_0_bit));
181 + if (mask & (DV_I_46_0_bit|DV_II_46_0_bit))
182 + mask &= ((0-((W[61]^(W[62]>>5))&(1<<0))) | ~(DV_I_46_0_bit|DV_II_46_0_bit));
183 + mask &= ((0-((W[61]^(W[62]>>5))&(1<<2))) | ~(DV_I_46_2_bit|DV_II_46_2_bit));
184 + if (mask & (DV_I_45_0_bit|DV_II_45_0_bit))
185 + mask &= ((0-((W[60]^(W[61]>>5))&(1<<0))) | ~(DV_I_45_0_bit|DV_II_45_0_bit));
186 + if (mask & (DV_II_51_0_bit|DV_II_54_0_bit))
187 + mask &= (((((W[58]^W[59])>>29)&1)-1) | ~(DV_II_51_0_bit|DV_II_54_0_bit));
188 + if (mask & (DV_II_50_0_bit|DV_II_53_0_bit))
189 + mask &= (((((W[57]^W[58])>>29)&1)-1) | ~(DV_II_50_0_bit|DV_II_53_0_bit));
190 + if (mask & (DV_II_52_0_bit|DV_II_54_0_bit))
191 + mask &= ((((W[56]^(W[59]>>25))&(1<<4))-(1<<4)) | ~(DV_II_52_0_bit|DV_II_54_0_bit));
192 + if (mask & (DV_II_51_0_bit|DV_II_52_0_bit))
193 + mask &= ((0-(((W[56]^W[59])>>29)&1)) | ~(DV_II_51_0_bit|DV_II_52_0_bit));
194 + if (mask & (DV_II_49_0_bit|DV_II_52_0_bit))
195 + mask &= (((((W[56]^W[57])>>29)&1)-1) | ~(DV_II_49_0_bit|DV_II_52_0_bit));
196 + if (mask & (DV_II_51_0_bit|DV_II_53_0_bit))
197 + mask &= ((((W[55]^(W[58]>>25))&(1<<4))-(1<<4)) | ~(DV_II_51_0_bit|DV_II_53_0_bit));
198 + if (mask & (DV_II_50_0_bit|DV_II_52_0_bit))
199 + mask &= ((((W[54]^(W[57]>>25))&(1<<4))-(1<<4)) | ~(DV_II_50_0_bit|DV_II_52_0_bit));
200 + if (mask & (DV_II_49_0_bit|DV_II_51_0_bit))
201 + mask &= ((((W[53]^(W[56]>>25))&(1<<4))-(1<<4)) | ~(DV_II_49_0_bit|DV_II_51_0_bit));
202 + mask &= ((((W[51]^(W[50]>>5))&(1<<1))-(1<<1)) | ~(DV_I_50_2_bit|DV_II_46_2_bit));
203 + mask &= ((((W[48]^W[50])&(1<<6))-(1<<6)) | ~(DV_I_50_2_bit|DV_II_46_2_bit));
204 + if (mask & (DV_I_51_0_bit|DV_I_52_0_bit))
205 + mask &= ((0-(((W[48]^W[55])>>29)&1)) | ~(DV_I_51_0_bit|DV_I_52_0_bit));
206 + mask &= ((((W[47]^W[49])&(1<<6))-(1<<6)) | ~(DV_I_49_2_bit|DV_I_51_2_bit));
207 + mask &= ((((W[48]^(W[47]>>5))&(1<<1))-(1<<1)) | ~(DV_I_47_2_bit|DV_II_51_2_bit));
208 + mask &= ((((W[46]^W[48])&(1<<6))-(1<<6)) | ~(DV_I_48_2_bit|DV_I_50_2_bit));
209 + mask &= ((((W[47]^(W[46]>>5))&(1<<1))-(1<<1)) | ~(DV_I_46_2_bit|DV_II_50_2_bit));
210 + mask &= ((0-((W[44]^(W[45]>>5))&(1<<1))) | ~(DV_I_51_2_bit|DV_II_49_2_bit));
211 + mask &= ((((W[43]^W[45])&(1<<6))-(1<<6)) | ~(DV_I_47_2_bit|DV_I_49_2_bit));
212 + mask &= (((((W[42]^W[44])>>6)&1)-1) | ~(DV_I_46_2_bit|DV_I_48_2_bit));
213 + mask &= ((((W[43]^(W[42]>>5))&(1<<1))-(1<<1)) | ~(DV_II_46_2_bit|DV_II_51_2_bit));
214 + mask &= ((((W[42]^(W[41]>>5))&(1<<1))-(1<<1)) | ~(DV_I_51_2_bit|DV_II_50_2_bit));
215 + mask &= ((((W[41]^(W[40]>>5))&(1<<1))-(1<<1)) | ~(DV_I_50_2_bit|DV_II_49_2_bit));
216 + if (mask & (DV_I_52_0_bit|DV_II_51_0_bit))
217 + mask &= ((((W[39]^(W[43]>>25))&(1<<4))-(1<<4)) | ~(DV_I_52_0_bit|DV_II_51_0_bit));
218 + if (mask & (DV_I_51_0_bit|DV_II_50_0_bit))
219 + mask &= ((((W[38]^(W[42]>>25))&(1<<4))-(1<<4)) | ~(DV_I_51_0_bit|DV_II_50_0_bit));
220 + if (mask & (DV_I_48_2_bit|DV_I_51_2_bit))
221 + mask &= ((0-((W[37]^(W[38]>>5))&(1<<1))) | ~(DV_I_48_2_bit|DV_I_51_2_bit));
222 + if (mask & (DV_I_50_0_bit|DV_II_49_0_bit))
223 + mask &= ((((W[37]^(W[41]>>25))&(1<<4))-(1<<4)) | ~(DV_I_50_0_bit|DV_II_49_0_bit));
224 + if (mask & (DV_II_52_0_bit|DV_II_54_0_bit))
225 + mask &= ((0-((W[36]^W[38])&(1<<4))) | ~(DV_II_52_0_bit|DV_II_54_0_bit));
226 + mask &= ((0-((W[35]^(W[36]>>5))&(1<<1))) | ~(DV_I_46_2_bit|DV_I_49_2_bit));
227 + if (mask & (DV_I_51_0_bit|DV_II_47_0_bit))
228 + mask &= ((((W[35]^(W[39]>>25))&(1<<3))-(1<<3)) | ~(DV_I_51_0_bit|DV_II_47_0_bit));
229 +if (mask) {
230 +
231 + if (mask & DV_I_43_0_bit)
232 + if (
233 + !((W[61]^(W[62]>>5)) & (1<<1))
234 + || !(!((W[59]^(W[63]>>25)) & (1<<5)))
235 + || !((W[58]^(W[63]>>30)) & (1<<0))
236 + ) mask &= ~DV_I_43_0_bit;
237 + if (mask & DV_I_44_0_bit)
238 + if (
239 + !((W[62]^(W[63]>>5)) & (1<<1))
240 + || !(!((W[60]^(W[64]>>25)) & (1<<5)))
241 + || !((W[59]^(W[64]>>30)) & (1<<0))
242 + ) mask &= ~DV_I_44_0_bit;
243 + if (mask & DV_I_46_2_bit)
244 + mask &= ((~((W[40]^W[42])>>2)) | ~DV_I_46_2_bit);
245 + if (mask & DV_I_47_2_bit)
246 + if (
247 + !((W[62]^(W[63]>>5)) & (1<<2))
248 + || !(!((W[41]^W[43]) & (1<<6)))
249 + ) mask &= ~DV_I_47_2_bit;
250 + if (mask & DV_I_48_2_bit)
251 + if (
252 + !((W[63]^(W[64]>>5)) & (1<<2))
253 + || !(!((W[48]^(W[49]<<5)) & (1<<6)))
254 + ) mask &= ~DV_I_48_2_bit;
255 + if (mask & DV_I_49_2_bit)
256 + if (
257 + !(!((W[49]^(W[50]<<5)) & (1<<6)))
258 + || !((W[42]^W[50]) & (1<<1))
259 + || !(!((W[39]^(W[40]<<5)) & (1<<6)))
260 + || !((W[38]^W[40]) & (1<<1))
261 + ) mask &= ~DV_I_49_2_bit;
262 + if (mask & DV_I_50_0_bit)
263 + mask &= ((((W[36]^W[37])<<7)) | ~DV_I_50_0_bit);
264 + if (mask & DV_I_50_2_bit)
265 + mask &= ((((W[43]^W[51])<<11)) | ~DV_I_50_2_bit);
266 + if (mask & DV_I_51_0_bit)
267 + mask &= ((((W[37]^W[38])<<9)) | ~DV_I_51_0_bit);
268 + if (mask & DV_I_51_2_bit)
269 + if (
270 + !(!((W[51]^(W[52]<<5)) & (1<<6)))
271 + || !(!((W[49]^W[51]) & (1<<6)))
272 + || !(!((W[37]^(W[37]>>5)) & (1<<1)))
273 + || !(!((W[35]^(W[39]>>25)) & (1<<5)))
274 + ) mask &= ~DV_I_51_2_bit;
275 + if (mask & DV_I_52_0_bit)
276 + mask &= ((((W[38]^W[39])<<11)) | ~DV_I_52_0_bit);
277 + if (mask & DV_II_46_2_bit)
278 + mask &= ((((W[47]^W[51])<<17)) | ~DV_II_46_2_bit);
279 + if (mask & DV_II_48_0_bit)
280 + if (
281 + !(!((W[36]^(W[40]>>25)) & (1<<3)))
282 + || !((W[35]^(W[40]<<2)) & (1<<30))
283 + ) mask &= ~DV_II_48_0_bit;
284 + if (mask & DV_II_49_0_bit)
285 + if (
286 + !(!((W[37]^(W[41]>>25)) & (1<<3)))
287 + || !((W[36]^(W[41]<<2)) & (1<<30))
288 + ) mask &= ~DV_II_49_0_bit;
289 + if (mask & DV_II_49_2_bit)
290 + if (
291 + !(!((W[53]^(W[54]<<5)) & (1<<6)))
292 + || !(!((W[51]^W[53]) & (1<<6)))
293 + || !((W[50]^W[54]) & (1<<1))
294 + || !(!((W[45]^(W[46]<<5)) & (1<<6)))
295 + || !(!((W[37]^(W[41]>>25)) & (1<<5)))
296 + || !((W[36]^(W[41]>>30)) & (1<<0))
297 + ) mask &= ~DV_II_49_2_bit;
298 + if (mask & DV_II_50_0_bit)
299 + if (
300 + !((W[55]^W[58]) & (1<<29))
301 + || !(!((W[38]^(W[42]>>25)) & (1<<3)))
302 + || !((W[37]^(W[42]<<2)) & (1<<30))
303 + ) mask &= ~DV_II_50_0_bit;
304 + if (mask & DV_II_50_2_bit)
305 + if (
306 + !(!((W[54]^(W[55]<<5)) & (1<<6)))
307 + || !(!((W[52]^W[54]) & (1<<6)))
308 + || !((W[51]^W[55]) & (1<<1))
309 + || !((W[45]^W[47]) & (1<<1))
310 + || !(!((W[38]^(W[42]>>25)) & (1<<5)))
311 + || !((W[37]^(W[42]>>30)) & (1<<0))
312 + ) mask &= ~DV_II_50_2_bit;
313 + if (mask & DV_II_51_0_bit)
314 + if (
315 + !(!((W[39]^(W[43]>>25)) & (1<<3)))
316 + || !((W[38]^(W[43]<<2)) & (1<<30))
317 + ) mask &= ~DV_II_51_0_bit;
318 + if (mask & DV_II_51_2_bit)
319 + if (
320 + !(!((W[55]^(W[56]<<5)) & (1<<6)))
321 + || !(!((W[53]^W[55]) & (1<<6)))
322 + || !((W[52]^W[56]) & (1<<1))
323 + || !((W[46]^W[48]) & (1<<1))
324 + || !(!((W[39]^(W[43]>>25)) & (1<<5)))
325 + || !((W[38]^(W[43]>>30)) & (1<<0))
326 + ) mask &= ~DV_II_51_2_bit;
327 + if (mask & DV_II_52_0_bit)
328 + if (
329 + !(!((W[59]^W[60]) & (1<<29)))
330 + || !(!((W[40]^(W[44]>>25)) & (1<<3)))
331 + || !(!((W[40]^(W[44]>>25)) & (1<<4)))
332 + || !((W[39]^(W[44]<<2)) & (1<<30))
333 + ) mask &= ~DV_II_52_0_bit;
334 + if (mask & DV_II_53_0_bit)
335 + if (
336 + !((W[58]^W[61]) & (1<<29))
337 + || !(!((W[57]^(W[61]>>25)) & (1<<4)))
338 + || !(!((W[41]^(W[45]>>25)) & (1<<3)))
339 + || !(!((W[41]^(W[45]>>25)) & (1<<4)))
340 + ) mask &= ~DV_II_53_0_bit;
341 + if (mask & DV_II_54_0_bit)
342 + if (
343 + !(!((W[58]^(W[62]>>25)) & (1<<4)))
344 + || !(!((W[42]^(W[46]>>25)) & (1<<3)))
345 + || !(!((W[42]^(W[46]>>25)) & (1<<4)))
346 + ) mask &= ~DV_II_54_0_bit;
347 + if (mask & DV_II_55_0_bit)
348 + if (
349 + !(!((W[59]^(W[63]>>25)) & (1<<4)))
350 + || !(!((W[57]^(W[59]>>25)) & (1<<4)))
351 + || !(!((W[43]^(W[47]>>25)) & (1<<3)))
352 + || !(!((W[43]^(W[47]>>25)) & (1<<4)))
353 + ) mask &= ~DV_II_55_0_bit;
354 + if (mask & DV_II_56_0_bit)
355 + if (
356 + !(!((W[60]^(W[64]>>25)) & (1<<4)))
357 + || !(!((W[44]^(W[48]>>25)) & (1<<3)))
358 + || !(!((W[44]^(W[48]>>25)) & (1<<4)))
359 + ) mask &= ~DV_II_56_0_bit;
360 +}
361 +
362 + dvmask[0]=mask;
363 +}
sha1dc/ubc_check.h new
+46
@@ -0,0 +1,46 @@
1 +/***
2 +* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
3 +* Distributed under the MIT Software License.
4 +* See accompanying file LICENSE.txt or copy at
5 +* https://opensource.org/licenses/MIT
6 +***/
7 +
8 +/*
9 +// this file was generated by the 'parse_bitrel' program in the tools section
10 +// using the data files from directory 'tools/data/3565'
11 +//
12 +// sha1_dvs contains a list of SHA-1 Disturbance Vectors (DV) to check
13 +// dvType, dvK and dvB define the DV: I(K,B) or II(K,B) (see the paper)
14 +// dm[80] is the expanded message block XOR-difference defined by the DV
15 +// testt is the step to do the recompression from for collision detection
16 +// maski and maskb define the bit to check for each DV in the dvmask returned by ubc_check
17 +//
18 +// ubc_check takes as input an expanded message block and verifies the unavoidable bitconditions for all listed DVs
19 +// it returns a dvmask where each bit belonging to a DV is set if all unavoidable bitconditions for that DV have been met
20 +// thus one needs to do the recompression check for each DV that has its bit set
21 +*/
22 +
23 +#ifndef UBC_CHECK_H
24 +#define UBC_CHECK_H
25 +
26 +#if defined(__cplusplus)
27 +extern "C" {
28 +#endif
29 +
30 +#include <stdint.h>
31 +
32 +#define DVMASKSIZE 1
33 +typedef struct { int dvType; int dvK; int dvB; int testt; int maski; int maskb; uint32_t dm[80]; } dv_info_t;
34 +extern dv_info_t sha1_dvs[];
35 +void ubc_check(const uint32_t W[80], uint32_t dvmask[DVMASKSIZE]);
36 +
37 +#define DOSTORESTATE58
38 +#define DOSTORESTATE65
39 +
40 +#define CHECK_DVMASK(_DVMASK) (0 != _DVMASK[0])
41 +
42 +#if defined(__cplusplus)
43 +}
44 +#endif
45 +
46 +#endif /* UBC_CHECK_H */