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
52
53
54
55
56
57
58
59
60
61
62
63
64
|
//
// library.h
// lib-gpu-verify
//
// Created by Cedric Zwahlen on 07.01.2024.
//
#ifndef universal_h
#define universal_h
#include <stdio.h>
#include <time.h>
#include <stdint.h>
//#define GPUV_BIT_LENGTH 2048 // put in enum
void gpuv_prepare_gcry(void);
// new
struct gpuv_public_key;
struct gpuv_signature_message;
struct gpuv_batch;
struct gpuv_info;
struct gpuv_state;
enum GPUV_VARIANT {
GPUV_GPU_REGULAR = 0,
GPUV_GPU_MONTGOMERY = 1,
GPUV_CPU = 2
};
enum GPUV_BIT_LENGTH {
GPUV_BIT_LENGTH_2048 = 2048,
};
struct gpuv_info * gpuv_init(enum GPUV_VARIANT variant, enum GPUV_BIT_LENGTH bit_length);
struct gpuv_batch * gpuv_prepare_batch(void);
int gpuv_add_to_batch(struct gpuv_batch * batch, struct gpuv_signature_message * sigmem);
struct gpuv_signature_message * gpuv_prepare_sig_msg(struct gpuv_public_key *pubkey);
void gpuv_add_signature(struct gpuv_signature_message * sig_msg, unsigned long len, void *s);
void gpuv_add_message(struct gpuv_signature_message * sig_msg, unsigned long len, void *m);
struct gpuv_public_key * gpuv_prepare_pubkey(unsigned long e, unsigned long len_n, void *n);
//gpuv_get_pubkey(MONTGOMERY, exp_buf[i], len, &n_buf[len * i]);
void gpuv_free_batch(struct gpuv_batch * batch);
void gpuv_free_state(struct gpuv_state * state);
struct gpuv_state * gpuv_prepare(struct gpuv_info *info, struct gpuv_batch * batch);
int gpuv_start(struct gpuv_state *state, void (*cls)(void *, int, struct timespec, unsigned long, uint32_t *), void * arg, struct gpuv_batch *batch);
void gpuv_finish(struct gpuv_info * info);
#endif /* universal_h */
|