Monero
Loading...
Searching...
No Matches
CryptonightR_JIT.h
Go to the documentation of this file.
1#ifndef CRYPTONIGHTR_JIT_H
2#define CRYPTONIGHTR_JIT_H
3
4// Minimalistic JIT code generator for random math sequence in CryptonightR
5//
6// Usage:
7// - Allocate writable and executable memory
8// - Call v4_generate_JIT_code with "buf" pointed to memory allocated on previous step
9// - Call the generated code instead of "v4_random_math(code, r)", omit the "code" parameter
10
12#if defined __i386 || defined __x86_64__
13__attribute__((sysv_abi))
14#endif
15;
16
17// Given the random math sequence, generates machine code (x86-64) for it
18// Returns 0 if code was generated successfully
19// Returns -1 if provided buffer was too small
20int v4_generate_JIT_code(const struct V4_Instruction* code, v4_random_math_JIT_func buf, const size_t buf_size);
21
22#endif // CRYPTONIGHTR_JIT_H
int v4_generate_JIT_code(const struct V4_Instruction *code, v4_random_math_JIT_func buf, const size_t buf_size)
Definition CryptonightR_JIT.c:58
void(* v4_random_math_JIT_func)(uint32_t *r)
Definition CryptonightR_JIT.h:11
const portMappingElt code
Definition portlistingparse.c:22
const char * buf
Definition slow_memmem.cpp:73
__attribute__((noreturn)) void CXA_THROW(void *ex
unsigned int uint32_t
Definition stdint.h:126
Definition variant4_random_math.h:54