summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu/crypto/cryptonight.h
diff options
context:
space:
mode:
Diffstat (limited to 'xmrstak/backend/cpu/crypto/cryptonight.h')
-rw-r--r--xmrstak/backend/cpu/crypto/cryptonight.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/xmrstak/backend/cpu/crypto/cryptonight.h b/xmrstak/backend/cpu/crypto/cryptonight.h
new file mode 100644
index 0000000..978c798
--- /dev/null
+++ b/xmrstak/backend/cpu/crypto/cryptonight.h
@@ -0,0 +1,31 @@
+#ifndef __CRYPTONIGHT_H_INCLUDED
+#define __CRYPTONIGHT_H_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <inttypes.h>
+
+#define MEMORY 2097152
+
+typedef struct {
+ uint8_t hash_state[224]; // Need only 200, explicit align
+ uint8_t* long_state;
+ uint8_t ctx_info[24]; //Use some of the extra memory for flags
+} cryptonight_ctx;
+
+typedef struct {
+ const char* warning;
+} alloc_msg;
+
+size_t cryptonight_init(size_t use_fast_mem, size_t use_mlock, alloc_msg* msg);
+cryptonight_ctx* cryptonight_alloc_ctx(size_t use_fast_mem, size_t use_mlock, alloc_msg* msg);
+void cryptonight_free_ctx(cryptonight_ctx* ctx);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
OpenPOWER on IntegriCloud