Fix prefix.

This commit is contained in:
XMRig 2019-08-16 04:16:29 +07:00
parent 043989e8ee
commit 1c00721de3

View file

@ -418,31 +418,31 @@ void rxa2_initial_hash(uint8_t *blockhash, argon2_context *context, argon2_type
return; return;
} }
blake2b_init(&BlakeHash, ARGON2_PREHASH_DIGEST_LENGTH); rx_blake2b_init(&BlakeHash, ARGON2_PREHASH_DIGEST_LENGTH);
store32(&value, context->lanes); store32(&value, context->lanes);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
store32(&value, context->outlen); store32(&value, context->outlen);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
store32(&value, context->m_cost); store32(&value, context->m_cost);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
store32(&value, context->t_cost); store32(&value, context->t_cost);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
store32(&value, context->version); store32(&value, context->version);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
store32(&value, (uint32_t)type); store32(&value, (uint32_t)type);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
store32(&value, context->pwdlen); store32(&value, context->pwdlen);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
if (context->pwd != NULL) { if (context->pwd != NULL) {
blake2b_update(&BlakeHash, (const uint8_t *)context->pwd, rx_blake2b_update(&BlakeHash, (const uint8_t *)context->pwd,
context->pwdlen); context->pwdlen);
if (context->flags & ARGON2_FLAG_CLEAR_PASSWORD) { if (context->flags & ARGON2_FLAG_CLEAR_PASSWORD) {
@ -452,17 +452,17 @@ void rxa2_initial_hash(uint8_t *blockhash, argon2_context *context, argon2_type
} }
store32(&value, context->saltlen); store32(&value, context->saltlen);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
if (context->salt != NULL) { if (context->salt != NULL) {
blake2b_update(&BlakeHash, (const uint8_t *)context->salt, context->saltlen); rx_blake2b_update(&BlakeHash, (const uint8_t *)context->salt, context->saltlen);
} }
store32(&value, context->secretlen); store32(&value, context->secretlen);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
if (context->secret != NULL) { if (context->secret != NULL) {
blake2b_update(&BlakeHash, (const uint8_t *)context->secret, rx_blake2b_update(&BlakeHash, (const uint8_t *)context->secret,
context->secretlen); context->secretlen);
if (context->flags & ARGON2_FLAG_CLEAR_SECRET) { if (context->flags & ARGON2_FLAG_CLEAR_SECRET) {
@ -472,14 +472,14 @@ void rxa2_initial_hash(uint8_t *blockhash, argon2_context *context, argon2_type
} }
store32(&value, context->adlen); store32(&value, context->adlen);
blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value)); rx_blake2b_update(&BlakeHash, (const uint8_t *)&value, sizeof(value));
if (context->ad != NULL) { if (context->ad != NULL) {
blake2b_update(&BlakeHash, (const uint8_t *)context->ad, rx_blake2b_update(&BlakeHash, (const uint8_t *)context->ad,
context->adlen); context->adlen);
} }
blake2b_final(&BlakeHash, blockhash, ARGON2_PREHASH_DIGEST_LENGTH); rx_blake2b_final(&BlakeHash, blockhash, ARGON2_PREHASH_DIGEST_LENGTH);
} }
int rxa2_argon_initialize(argon2_instance_t *instance, argon2_context *context) { int rxa2_argon_initialize(argon2_instance_t *instance, argon2_context *context) {