Tor
0.4.9.2-alpha-dev
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerator
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
b
c
d
f
g
h
l
m
n
o
p
r
s
v
Enumerations
a
b
c
d
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
g
h
i
m
n
o
p
q
r
s
t
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
ext
equix
hashx
src
program.h
1
/* Copyright (c) 2020 tevador <tevador@gmail.com> */
2
/* See LICENSE for licensing information */
3
4
#ifndef PROGRAM_H
5
#define PROGRAM_H
6
7
#include <stdint.h>
8
#include <stdbool.h>
9
#include <hashx.h>
10
#include "instruction.h"
11
#include "siphash.h"
12
#include "blake2.h"
13
14
#define HASHX_PROGRAM_MAX_SIZE 512
15
16
typedef
struct
hashx_program
{
17
instruction
code[HASHX_PROGRAM_MAX_SIZE];
18
size_t
code_size;
19
#ifdef HASHX_PROGRAM_STATS
20
unsigned
counter;
21
double
ipc;
22
int
x86_size;
23
int
cpu_latency;
24
int
asic_latency;
25
int
mul_count;
26
int
wide_mul_count;
27
int
cpu_latencies[8];
28
int
asic_latencies[8];
29
int
branch_count;
30
int
branches[16];
31
#endif
32
#ifdef HASHX_RNG_CALLBACK
33
void (*rng_callback)(uint64_t *buffer,
void
*user_data);
34
void
*rng_callback_user_data;
35
#endif
36
}
hashx_program
;
37
38
#ifdef __cplusplus
39
extern
"C"
{
40
#endif
41
42
HASHX_PRIVATE
bool
hashx_program_generate(
const
siphash_state
* key,
hashx_program
* program);
43
44
HASHX_PRIVATE
void
hashx_program_execute(
const
hashx_program
* program, uint64_t r[8]);
45
46
HASHX_PRIVATE
void
hashx_program_asm_x86(
const
hashx_program
* program);
47
48
#ifdef __cplusplus
49
}
50
#endif
51
52
#endif
hashx_program
Definition:
program.h:16
instruction
Definition:
instruction.h:23
siphash_state
Definition:
siphash.h:20
Generated by
1.9.4