#include "miner.h"
#include "algo-gate-api.h"
#include <string.h>
#include <inttypes.h>
Go to the source code of this file.
|
#define | Ch(x, y, z) ((x & (y ^ z)) ^ z) |
|
#define | Maj(x, y, z) ((x & (y | z)) | (y & z)) |
|
#define | ROTR(x, n) ((x >> n) | (x << (32 - n))) |
|
#define | S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) |
|
#define | S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) |
|
#define | s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ (x >> 3)) |
|
#define | s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ (x >> 10)) |
|
#define | RND(a, b, c, d, e, f, g, h, k) |
|
#define | RNDr(S, W, i) |
|
◆ Ch
#define Ch |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((x & (y ^ z)) ^ z) |
◆ Maj
#define Maj |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((x & (y | z)) | (y & z)) |
◆ RND
#define RND |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
e, |
|
|
|
f, |
|
|
|
g, |
|
|
|
h, |
|
|
|
k |
|
) |
| |
Value:do { \
t0 = h +
S1(e) +
Ch(e, f, g) + k; \
t1 =
S0(a) +
Maj(a, b, c); \
d += t0; \
h = t0 + t1; \
} while (0)
Definition at line 60 of file sha2.c.
◆ RNDr
Value:RND(
S[(64 - i) % 8],
S[(65 - i) % 8], \
S[(66 - i) % 8],
S[(67 - i) % 8], \
S[(68 - i) % 8],
S[(69 - i) % 8], \
S[(70 - i) % 8],
S[(71 - i) % 8], \
W[i] + sha256_k[i])
#define RND(a, b, c, d, e, f, g, h, k)
#define S(x0, x1, x2, x3, cb, r)
Definition at line 69 of file sha2.c.
◆ ROTR
#define ROTR |
( |
|
x, |
|
|
|
n |
|
) |
| ((x >> n) | (x << (32 - n))) |
◆ S0
◆ s0
#define s0 |
( |
|
x | ) |
(ROTR(x, 7) ^ ROTR(x, 18) ^ (x >> 3)) |
◆ S1
◆ s1
#define s1 |
( |
|
x | ) |
(ROTR(x, 17) ^ ROTR(x, 19) ^ (x >> 10)) |
◆ register_sha256d_algo()
bool register_sha256d_algo |
( |
algo_gate_t * |
gate | ) |
|
◆ scanhash_sha256d()
int scanhash_sha256d |
( |
int |
thr_id, |
|
|
struct work * |
work, |
|
|
uint32_t |
max_nonce, |
|
|
uint64_t * |
hashes_done |
|
) |
| |
◆ sha256_init()
void sha256_init |
( |
uint32_t * |
state | ) |
|
◆ sha256_transform()
void sha256_transform |
( |
uint32_t * |
state, |
|
|
const uint32_t * |
block, |
|
|
int |
swap |
|
) |
| |
◆ sha256d()
void sha256d |
( |
unsigned char * |
hash, |
|
|
const unsigned char * |
data, |
|
|
int |
len |
|
) |
| |