Add prefixes to argon2 to avoid potential conflicts with other implementations.

This commit is contained in:
XMRig 2020-05-04 18:09:34 +07:00
parent b34e3e1a7b
commit 4326ba3c38
No known key found for this signature in database
GPG key ID: 446A53638BE94409
20 changed files with 134 additions and 207 deletions

View file

@ -210,8 +210,7 @@ static void next_addresses(block *address_block, block *input_block)
fill_block(zero2_block, address_block, address_block, 0);
}
void fill_segment_avx512f(const argon2_instance_t *instance,
argon2_position_t position)
void xmrig_ar2_fill_segment_avx512f(const argon2_instance_t *instance, argon2_position_t position)
{
block *ref_block = NULL, *curr_block = NULL;
block address_block, input_block;
@ -295,8 +294,7 @@ void fill_segment_avx512f(const argon2_instance_t *instance,
* lane.
*/
position.index = i;
ref_index = index_alpha(instance, &position, pseudo_rand & 0xFFFFFFFF,
ref_lane == position.lane);
ref_index = xmrig_ar2_index_alpha(instance, &position, pseudo_rand & 0xFFFFFFFF, ref_lane == position.lane);
/* 2 Creating a new block */
ref_block =
@ -312,21 +310,14 @@ void fill_segment_avx512f(const argon2_instance_t *instance,
}
}
int check_avx512f(void)
int xmrig_ar2_check_avx512f(void)
{
return cpu_flags_have_avx512f();
}
#else
void fill_segment_avx512f(const argon2_instance_t *instance,
argon2_position_t position)
{
}
int check_avx512f(void)
{
return 0;
}
void xmrig_ar2_fill_segment_avx512f(const argon2_instance_t *instance, argon2_position_t position) {}
int xmrig_ar2_check_avx512f(void) { return 0; }
#endif