-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcsolv.h
51 lines (43 loc) · 1.21 KB
/
csolv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright Douglas Goddard 2016
// Licensed under the MIT license
#include <sodium.h>
#include <thrust/sort.h>
#include <thrust/copy.h>
#include <thrust/device_vector.h>
#include <set>
#define BLOCK_SIZE 128
#define CUDA_BLAKE2B_BLOCKBYTES 128
#define CUDA_N 200
#define CUDA_K 9
#define CUDA_BLAKE2B_STATE crypto_generichash_blake2b_state
void cuda_generate_hash(
const CUDA_BLAKE2B_STATE *base_state,
uint32_t hash_count,
unsigned char *h_out);
void cuda_solve_hashes(
unsigned char* h_in,
uint32_t in_size,
unsigned char *h_out,
uint32_t out_size);
void cuda_final_collision_step(
unsigned char **d_hashes,
uint32_t *d_sort_indices,
uint32_t **d_ij_buf,
uint32_t r,
uint32_t *buf_sizes);
void cuda_xor_step(
unsigned char **d_hashes,
uint32_t *d_sort_indices,
uint32_t **d_ij_buf,
uint32_t r,
uint32_t *buf_sizes);
uint32_t cuda_reduce_pairs(
uint32_t **d_ij_buf,
uint32_t r,
uint32_t *buf_sizes,
uint32_t size,
uint32_t sum_prev_size,
uint32_t block_count);
__global__ void initialize_to_one(
uint32_t *reduction,
uint32_t size);