46#define ARGON2_MIN_LANES UINT32_C(1)
47#define ARGON2_MAX_LANES UINT32_C(0xFFFFFF)
50#define ARGON2_MIN_THREADS UINT32_C(1)
51#define ARGON2_MAX_THREADS UINT32_C(0xFFFFFF)
54#define ARGON2_SYNC_POINTS UINT32_C(4)
57#define ARGON2_MIN_OUTLEN UINT32_C(4)
58#define ARGON2_MAX_OUTLEN UINT32_C(0xFFFFFFFF)
61#define ARGON2_MIN_MEMORY (2 * ARGON2_SYNC_POINTS)
63#define ARGON2_MIN(a, b) ((a) < (b) ? (a) : (b))
65#define ARGON2_MAX_MEMORY_BITS \
66 ARGON2_MIN(UINT32_C(32), (sizeof(void *) * CHAR_BIT - 10 - 1))
67#define ARGON2_MAX_MEMORY \
68 ARGON2_MIN(UINT32_C(0xFFFFFFFF), UINT64_C(1) << ARGON2_MAX_MEMORY_BITS)
71#define ARGON2_MIN_TIME UINT32_C(1)
72#define ARGON2_MAX_TIME UINT32_C(0xFFFFFFFF)
75#define ARGON2_MIN_PWD_LENGTH UINT32_C(0)
76#define ARGON2_MAX_PWD_LENGTH UINT32_C(0xFFFFFFFF)
79#define ARGON2_MIN_AD_LENGTH UINT32_C(0)
80#define ARGON2_MAX_AD_LENGTH UINT32_C(0xFFFFFFFF)
83#define ARGON2_MIN_SALT_LENGTH UINT32_C(8)
84#define ARGON2_MAX_SALT_LENGTH UINT32_C(0xFFFFFFFF)
87#define ARGON2_MIN_SECRET UINT32_C(0)
88#define ARGON2_MAX_SECRET UINT32_C(0xFFFFFFFF)
91#define ARGON2_DEFAULT_FLAGS UINT32_C(0)
92#define ARGON2_FLAG_CLEAR_PASSWORD (UINT32_C(1) << 0)
93#define ARGON2_FLAG_CLEAR_SECRET (UINT32_C(1) << 1)
241#if defined(__cplusplus)
259#if defined(__cplusplus)
enum Argon2_type argon2_type
Argon2_ErrorCodes
Definition argon2.h:97
@ ARGON2_INCORRECT_TYPE
Definition argon2.h:137
@ ARGON2_LANES_TOO_FEW
Definition argon2.h:123
@ ARGON2_OK
Definition argon2.h:98
@ ARGON2_LANES_TOO_MANY
Definition argon2.h:124
@ ARGON2_INCORRECT_PARAMETER
Definition argon2.h:136
@ ARGON2_SECRET_TOO_SHORT
Definition argon2.h:114
@ ARGON2_PWD_TOO_LONG
Definition argon2.h:106
@ ARGON2_PWD_TOO_SHORT
Definition argon2.h:105
@ ARGON2_MEMORY_ALLOCATION_ERROR
Definition argon2.h:131
@ ARGON2_AD_PTR_MISMATCH
Definition argon2.h:129
@ ARGON2_OUT_PTR_MISMATCH
Definition argon2.h:139
@ ARGON2_MISSING_ARGS
Definition argon2.h:144
@ ARGON2_THREAD_FAIL
Definition argon2.h:150
@ ARGON2_SALT_TOO_SHORT
Definition argon2.h:108
@ ARGON2_OUTPUT_TOO_LONG
Definition argon2.h:103
@ ARGON2_AD_TOO_LONG
Definition argon2.h:112
@ ARGON2_DECODING_LENGTH_FAIL
Definition argon2.h:152
@ ARGON2_SALT_TOO_LONG
Definition argon2.h:109
@ ARGON2_MEMORY_TOO_LITTLE
Definition argon2.h:120
@ ARGON2_TIME_TOO_LARGE
Definition argon2.h:118
@ ARGON2_THREADS_TOO_MANY
Definition argon2.h:142
@ ARGON2_ENCODING_FAIL
Definition argon2.h:146
@ ARGON2_MEMORY_TOO_MUCH
Definition argon2.h:121
@ ARGON2_PWD_PTR_MISMATCH
Definition argon2.h:126
@ ARGON2_SECRET_TOO_LONG
Definition argon2.h:115
@ ARGON2_THREADS_TOO_FEW
Definition argon2.h:141
@ ARGON2_SECRET_PTR_MISMATCH
Definition argon2.h:128
@ ARGON2_AD_TOO_SHORT
Definition argon2.h:111
@ ARGON2_TIME_TOO_SMALL
Definition argon2.h:117
@ ARGON2_FREE_MEMORY_CBK_NULL
Definition argon2.h:133
@ ARGON2_OUTPUT_PTR_NULL
Definition argon2.h:100
@ ARGON2_DECODING_FAIL
Definition argon2.h:148
@ ARGON2_SALT_PTR_MISMATCH
Definition argon2.h:127
@ ARGON2_ALLOCATE_MEMORY_CBK_NULL
Definition argon2.h:134
@ ARGON2_VERIFY_MISMATCH
Definition argon2.h:154
@ ARGON2_OUTPUT_TOO_SHORT
Definition argon2.h:102
struct Argon2_Context argon2_context
enum Argon2_ErrorCodes argon2_error_codes
void randomx_argon2_fill_segment_ref(const argon2_instance_t *instance, argon2_position_t position)
Definition argon2_ref.c:110
int(* allocate_fptr)(uint8_t **memory, size_t bytes_to_allocate)
Definition argon2.h:158
Argon2_type
Definition argon2.h:218
@ Argon2_id
Definition argon2.h:221
@ Argon2_d
Definition argon2.h:219
@ Argon2_i
Definition argon2.h:220
struct Argon2_instance_t argon2_instance_t
Definition argon2.h:232
enum Argon2_version argon2_version
struct Argon2_position_t argon2_position_t
Definition argon2.h:235
void(* deallocate_fptr)(uint8_t *memory, size_t bytes_to_allocate)
Definition argon2.h:159
Argon2_version
Definition argon2.h:225
@ ARGON2_VERSION_10
Definition argon2.h:226
@ ARGON2_VERSION_13
Definition argon2.h:227
@ ARGON2_VERSION_NUMBER
Definition argon2.h:228
randomx_argon2_impl * randomx_argon2_impl_ssse3()
Definition argon2_ssse3.c:48
void randomx_argon2_impl(const argon2_instance_t *instance, argon2_position_t position)
Definition argon2.h:238
randomx_argon2_impl * randomx_argon2_impl_avx2()
Definition argon2_avx2.c:44
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124
uint8_t * pwd
Definition argon2.h:192
uint32_t outlen
Definition argon2.h:190
uint32_t flags
Definition argon2.h:214
uint32_t threads
Definition argon2.h:207
uint32_t saltlen
Definition argon2.h:196
uint8_t * ad
Definition argon2.h:201
uint32_t adlen
Definition argon2.h:202
uint32_t version
Definition argon2.h:209
uint8_t * salt
Definition argon2.h:195
deallocate_fptr free_cbk
Definition argon2.h:212
uint8_t * out
Definition argon2.h:189
uint32_t pwdlen
Definition argon2.h:193
uint32_t m_cost
Definition argon2.h:205
uint8_t * secret
Definition argon2.h:198
uint32_t lanes
Definition argon2.h:206
uint32_t secretlen
Definition argon2.h:199
uint32_t t_cost
Definition argon2.h:204
allocate_fptr allocate_cbk
Definition argon2.h:211
Definition argon2_core.h:82
Definition argon2_core.h:101