Add prefixes to argon2 to avoid potential conflicts with other implementations.
This commit is contained in:
parent
b34e3e1a7b
commit
4326ba3c38
20 changed files with 134 additions and 207 deletions
|
@ -27,11 +27,11 @@ void argon2_get_impl_list(argon2_impl_list *list)
|
|||
{
|
||||
static const argon2_impl IMPLS[] = {
|
||||
{ "x86_64", NULL, fill_segment_default },
|
||||
{ "SSE2", check_sse2, fill_segment_sse2 },
|
||||
{ "SSSE3", check_ssse3, fill_segment_ssse3 },
|
||||
{ "XOP", check_xop, fill_segment_xop },
|
||||
{ "AVX2", check_avx2, fill_segment_avx2 },
|
||||
{ "AVX-512F", check_avx512f, fill_segment_avx512f },
|
||||
{ "SSE2", xmrig_ar2_check_sse2, xmrig_ar2_fill_segment_sse2 },
|
||||
{ "SSSE3", xmrig_ar2_check_ssse3, xmrig_ar2_fill_segment_ssse3 },
|
||||
{ "XOP", xmrig_ar2_check_xop, xmrig_ar2_fill_segment_xop },
|
||||
{ "AVX2", xmrig_ar2_check_avx2, xmrig_ar2_fill_segment_avx2 },
|
||||
{ "AVX-512F", xmrig_ar2_check_avx512f, xmrig_ar2_fill_segment_avx512f },
|
||||
};
|
||||
|
||||
cpu_flags_get();
|
||||
|
|
|
@ -225,8 +225,7 @@ static void next_addresses(block *address_block, block *input_block)
|
|||
fill_block(zero2_block, address_block, address_block, 0);
|
||||
}
|
||||
|
||||
void fill_segment_avx2(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
void xmrig_ar2_fill_segment_avx2(const argon2_instance_t *instance, argon2_position_t position)
|
||||
{
|
||||
block *ref_block = NULL, *curr_block = NULL;
|
||||
block address_block, input_block;
|
||||
|
@ -310,8 +309,7 @@ void fill_segment_avx2(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 =
|
||||
|
@ -327,21 +325,14 @@ void fill_segment_avx2(const argon2_instance_t *instance,
|
|||
}
|
||||
}
|
||||
|
||||
int check_avx2(void)
|
||||
int xmrig_ar2_check_avx2(void)
|
||||
{
|
||||
return cpu_flags_have_avx2();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void fill_segment_avx2(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
{
|
||||
}
|
||||
|
||||
int check_avx2(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void xmrig_ar2_fill_segment_avx2(const argon2_instance_t *instance, argon2_position_t position) {}
|
||||
int xmrig_ar2_check_avx2(void) { return 0; }
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
#include "core.h"
|
||||
|
||||
void fill_segment_avx2(const argon2_instance_t *instance,
|
||||
argon2_position_t position);
|
||||
|
||||
int check_avx2(void);
|
||||
void xmrig_ar2_fill_segment_avx2(const argon2_instance_t *instance, argon2_position_t position);
|
||||
int xmrig_ar2_check_avx2(void);
|
||||
|
||||
#endif // ARGON2_AVX2_H
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
#include "core.h"
|
||||
|
||||
void fill_segment_avx512f(const argon2_instance_t *instance,
|
||||
argon2_position_t position);
|
||||
|
||||
int check_avx512f(void);
|
||||
void xmrig_ar2_fill_segment_avx512f(const argon2_instance_t *instance, argon2_position_t position);
|
||||
int xmrig_ar2_check_avx512f(void);
|
||||
|
||||
#endif // ARGON2_AVX512F_H
|
||||
|
|
|
@ -102,27 +102,19 @@ static __m128i f(__m128i x, __m128i y)
|
|||
|
||||
#include "argon2-template-128.h"
|
||||
|
||||
void fill_segment_sse2(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
void xmrig_ar2_fill_segment_sse2(const argon2_instance_t *instance, argon2_position_t position)
|
||||
{
|
||||
fill_segment_128(instance, position);
|
||||
}
|
||||
|
||||
int check_sse2(void)
|
||||
int xmrig_ar2_check_sse2(void)
|
||||
{
|
||||
return cpu_flags_have_sse2();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void fill_segment_sse2(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
{
|
||||
}
|
||||
|
||||
int check_sse2(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void xmrig_ar2_fill_segment_sse2(const argon2_instance_t *instance, argon2_position_t position) {}
|
||||
int xmrig_ar2_check_sse2(void) { return 0; }
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
#include "core.h"
|
||||
|
||||
void fill_segment_sse2(const argon2_instance_t *instance,
|
||||
argon2_position_t position);
|
||||
|
||||
int check_sse2(void);
|
||||
void xmrig_ar2_fill_segment_sse2(const argon2_instance_t *instance, argon2_position_t position);
|
||||
int xmrig_ar2_check_sse2(void);
|
||||
|
||||
#endif // ARGON2_SSE2_H
|
||||
|
|
|
@ -114,27 +114,19 @@ static __m128i f(__m128i x, __m128i y)
|
|||
|
||||
#include "argon2-template-128.h"
|
||||
|
||||
void fill_segment_ssse3(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
void xmrig_ar2_fill_segment_ssse3(const argon2_instance_t *instance, argon2_position_t position)
|
||||
{
|
||||
fill_segment_128(instance, position);
|
||||
}
|
||||
|
||||
int check_ssse3(void)
|
||||
int xmrig_ar2_check_ssse3(void)
|
||||
{
|
||||
return cpu_flags_have_ssse3();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void fill_segment_ssse3(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
{
|
||||
}
|
||||
|
||||
int check_ssse3(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void xmrig_ar2_fill_segment_ssse3(const argon2_instance_t *instance, argon2_position_t position) {}
|
||||
int xmrig_ar2_check_ssse3(void) { return 0; }
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
#include "core.h"
|
||||
|
||||
void fill_segment_ssse3(const argon2_instance_t *instance,
|
||||
argon2_position_t position);
|
||||
|
||||
int check_ssse3(void);
|
||||
void xmrig_ar2_fill_segment_ssse3(const argon2_instance_t *instance, argon2_position_t position);
|
||||
int xmrig_ar2_check_ssse3(void);
|
||||
|
||||
#endif // ARGON2_SSSE3_H
|
||||
|
|
|
@ -150,8 +150,7 @@ static void fill_segment_128(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 =
|
||||
|
|
16
src/3rdparty/argon2/arch/x86_64/lib/argon2-xop.c
vendored
16
src/3rdparty/argon2/arch/x86_64/lib/argon2-xop.c
vendored
|
@ -102,27 +102,19 @@ static __m128i f(__m128i x, __m128i y)
|
|||
|
||||
#include "argon2-template-128.h"
|
||||
|
||||
void fill_segment_xop(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
void xmrig_ar2_fill_segment_xop(const argon2_instance_t *instance, argon2_position_t position)
|
||||
{
|
||||
fill_segment_128(instance, position);
|
||||
}
|
||||
|
||||
int check_xop(void)
|
||||
int xmrig_ar2_check_xop(void)
|
||||
{
|
||||
return cpu_flags_have_xop();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void fill_segment_xop(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
{
|
||||
}
|
||||
|
||||
int check_xop(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
void xmrig_ar2_fill_segment_xop(const argon2_instance_t *instance, argon2_position_t position) {}
|
||||
int xmrig_ar2_check_xop(void) { return 0; }
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
#include "core.h"
|
||||
|
||||
void fill_segment_xop(const argon2_instance_t *instance,
|
||||
argon2_position_t position);
|
||||
|
||||
int check_xop(void);
|
||||
void xmrig_ar2_fill_segment_xop(const argon2_instance_t *instance, argon2_position_t position);
|
||||
int xmrig_ar2_check_xop(void);
|
||||
|
||||
#endif // ARGON2_XOP_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue