forked from Elbandi/sgminer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
algorithm.h
54 lines (46 loc) · 1.69 KB
/
algorithm.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
52
53
54
#ifndef ALGORITHM_H
#define ALGORITHM_H
#include <inttypes.h>
#include <stdbool.h>
struct work;
enum algorithm {
ALGO_SCRYPT, // kernels starting from this will have difficulty calculated by using litecoin algorithm
ALGO_NSCRYPT,
ALGO_SCRYPT_JANE,
ALGO_QUARKCOIN, // kernels starting from this will have difficulty calculated by using quarkcoin algorithm
ALGO_QUBITCOIN,
ALGO_INKCOIN,
ALGO_ANIMECOIN,
ALGO_SIFCOIN,
ALGO_DARKCOIN, // kernels starting from this will have difficulty calculated by using bitcoin algorithm
ALGO_DARKCOINMOD,
ALGO_MYRIADCOIN_GROESTL,
ALGO_TWECOIN,
ALGO_MARUCOIN,
ALGO_MARUCOINMOD,
ALGO_FUGUECOIN, // kernels starting from this will have difficulty calculated by using fuguecoin algorithm
ALGO_DIAMONDCOIN,
ALGO_GROESTLCOIN,
};
/* Describes the Scrypt parameters and hashing functions used to mine
* a specific coin.
*/
typedef struct _algorithm_t {
const char* name; /* Human-readable identifier */
char* kernelname; /* Default kernel */
uint32_t n; /* N (CPU/Memory tradeoff parameter) */
uint8_t nfactor; /* Factor of N above (n = 2^nfactor) */
enum algorithm algo;
double diff_multiplier1;
double diff_multiplier2;
unsigned long long diff_nonce;
unsigned long long diff_numerator;
void (*regenhash)(struct work *work);
} algorithm_t;
/* Set default parameters based on name. */
void set_algorithm(algorithm_t* algo, const char* name);
/* Set to specific N factor. */
void set_algorithm_nfactor(algorithm_t* algo, const uint8_t nfactor);
/* Compare two algorithm parameters */
bool cmp_algorithm(algorithm_t* algo1, algorithm_t* algo2);
#endif /* ALGORITHM_H */