■ ■ ■ ■ ■ ■
btcrecover/sha512-bc-kernel.cl
| skipped 179 lines |
180 | 180 | | }; |
181 | 181 | | |
182 | 182 | | |
| 183 | + | #define PFOUT8 "%16lx %16lx %16lx %16lx %16lx %16lx %16lx %16lx" |
| 184 | + | #define PFLETTERS a, b, c, d, e, f, g, h |
| 185 | + | |
| 186 | + | #define PFOUT16 PFOUT8 " " PFOUT8 |
| 187 | + | #define PFWS w[0], w[1], w[2], w[3], w[4], w[5], w[6], w[7], w[8], w[9], w[10], w[11], w[12], w[13], w[14], w[15] |
| 188 | + | |
183 | 189 | | // From sha512_kernel.cl |
184 | 190 | | |
185 | 191 | | __kernel |
| skipped 6 lines |
192 | 198 | | |
193 | 199 | | // Get location of the hash to work on for this kernel |
194 | 200 | | hashes_buffer += (get_global_id(0) << 3); |
| 201 | + | |
| 202 | + | printf("AA: " PFOUT8 "\n", hashes_buffer[0], hashes_buffer[1], hashes_buffer[2], hashes_buffer[3], hashes_buffer[4], hashes_buffer[5], hashes_buffer[6], hashes_buffer[7]); |
195 | 203 | | |
196 | 204 | | // Copy initial hash into local input variable and convert endianness |
197 | 205 | | #pragma unroll |
| skipped 19 lines |
217 | 225 | | g = H6; |
218 | 226 | | h = H7; |
219 | 227 | | |
| 228 | + | printf("BB: " PFOUT16 "\n", PFWS); |
| 229 | + | printf("BB: " PFOUT8 "\n", PFLETTERS); |
| 230 | + | |
220 | 231 | | #pragma unroll |
221 | 232 | | for (int i = 0; i < 16; i++) { |
222 | 233 | | t = k[i] + w[i] + h + Sigma1(e) + Ch(e, f, g); |
| skipped 7 lines |
230 | 241 | | c = b; |
231 | 242 | | b = a; |
232 | 243 | | a = t; |
| 244 | + | |
| 245 | + | printf("%2d: %16lx\n", i, t); |
| 246 | + | printf("%2d: " PFOUT8 "\n", i, PFLETTERS); |
233 | 247 | | } |
234 | 248 | | |
235 | 249 | | #pragma unroll |
| skipped 10 lines |
246 | 260 | | c = b; |
247 | 261 | | b = a; |
248 | 262 | | a = t; |
| 263 | + | |
| 264 | + | printf("%2d: %16lx\n", i, t); |
| 265 | + | printf("%2d: " PFOUT16 "\n", i, PFWS); |
| 266 | + | printf("%2d: " PFOUT8 "\n", i, PFLETTERS); |
249 | 267 | | } |
250 | 268 | | |
251 | 269 | | // Copy resulting SHA512 hash back into the local input variable |
| skipped 12 lines |
264 | 282 | | for (int i = 9; i < 15; i++) |
265 | 283 | | w[i] = 0; |
266 | 284 | | w[15] = 512; // The length in bits |
| 285 | + | |
| 286 | + | printf("ZZ: " PFOUT16 "\n", PFWS); |
267 | 287 | | } |
268 | 288 | | |
269 | 289 | | // Copy iterated SHA512 hash into the I/O buffer and convert endianness |
| skipped 5 lines |