aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/slow-hash.c
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2019-04-23 20:32:27 +0100
committerHoward Chu <hyc@symas.com>2019-09-25 21:29:42 +0100
commit81c2ad6d5b17cf280a4a55fd6159e8dde423f5a8 (patch)
tree7bb731b721183e73afbb60e01cf3759723e4948b /src/crypto/slow-hash.c
parentMerge pull request #5909 (diff)
downloadmonero-81c2ad6d5b17cf280a4a55fd6159e8dde423f5a8.tar.xz
RandomX integration
Support RandomX PoW algorithm
Diffstat (limited to 'src/crypto/slow-hash.c')
-rw-r--r--src/crypto/slow-hash.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c
index 647471513..88eb751a6 100644
--- a/src/crypto/slow-hash.c
+++ b/src/crypto/slow-hash.c
@@ -742,7 +742,7 @@ BOOL SetLockPagesPrivilege(HANDLE hProcess, BOOL bEnable)
* the allocated buffer.
*/
-void slow_hash_allocate_state(void)
+void cn_slow_hash_allocate_state(void)
{
if(hp_state != NULL)
return;
@@ -804,7 +804,7 @@ void slow_hash_allocate_state(void)
*@brief frees the state allocated by slow_hash_allocate_state
*/
-void slow_hash_free_state(void)
+void cn_slow_hash_free_state(void)
{
if(hp_state == NULL)
return;
@@ -892,7 +892,7 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
// this isn't supposed to happen, but guard against it for now.
if(hp_state == NULL)
- slow_hash_allocate_state();
+ cn_slow_hash_allocate_state();
// locals to avoid constant TLS dereferencing
uint8_t *local_hp_state = hp_state;
@@ -1009,13 +1009,13 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
}
#elif !defined NO_AES && (defined(__arm__) || defined(__aarch64__))
-void slow_hash_allocate_state(void)
+void cn_slow_hash_allocate_state(void)
{
// Do nothing, this is just to maintain compatibility with the upgraded slow-hash.c
return;
}
-void slow_hash_free_state(void)
+void cn_slow_hash_free_state(void)
{
// As above
return;
@@ -1582,13 +1582,13 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
#define hp_jitfunc ((v4_random_math_JIT_func)NULL)
-void slow_hash_allocate_state(void)
+void cn_slow_hash_allocate_state(void)
{
// Do nothing, this is just to maintain compatibility with the upgraded slow-hash.c
return;
}
-void slow_hash_free_state(void)
+void cn_slow_hash_free_state(void)
{
// As above
return;
@@ -1765,3 +1765,15 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
}
#endif
+
+void slow_hash_allocate_state(void)
+{
+ cn_slow_hash_allocate_state();
+ rx_slow_hash_allocate_state();
+}
+
+void slow_hash_free_state(void)
+{
+ cn_slow_hash_free_state();
+ rx_slow_hash_free_state();
+}