mirror of
https://git.wownero.com/wownero/RandomWOW.git
synced 2024-12-21 23:38:54 +00:00
Fix symbol collisions with blake2b (#145)
This commit is contained in:
parent
53af68c34a
commit
7567cef4c6
@ -307,13 +307,13 @@ void rxa2_fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instanc
|
|||||||
|
|
||||||
store32(blockhash + ARGON2_PREHASH_DIGEST_LENGTH, 0);
|
store32(blockhash + ARGON2_PREHASH_DIGEST_LENGTH, 0);
|
||||||
store32(blockhash + ARGON2_PREHASH_DIGEST_LENGTH + 4, l);
|
store32(blockhash + ARGON2_PREHASH_DIGEST_LENGTH + 4, l);
|
||||||
rxa2_blake2b_long(blockhash_bytes, ARGON2_BLOCK_SIZE, blockhash,
|
blake2b_long(blockhash_bytes, ARGON2_BLOCK_SIZE, blockhash,
|
||||||
ARGON2_PREHASH_SEED_LENGTH);
|
ARGON2_PREHASH_SEED_LENGTH);
|
||||||
load_block(&instance->memory[l * instance->lane_length + 0],
|
load_block(&instance->memory[l * instance->lane_length + 0],
|
||||||
blockhash_bytes);
|
blockhash_bytes);
|
||||||
|
|
||||||
store32(blockhash + ARGON2_PREHASH_DIGEST_LENGTH, 1);
|
store32(blockhash + ARGON2_PREHASH_DIGEST_LENGTH, 1);
|
||||||
rxa2_blake2b_long(blockhash_bytes, ARGON2_BLOCK_SIZE, blockhash,
|
blake2b_long(blockhash_bytes, ARGON2_BLOCK_SIZE, blockhash,
|
||||||
ARGON2_PREHASH_SEED_LENGTH);
|
ARGON2_PREHASH_SEED_LENGTH);
|
||||||
load_block(&instance->memory[l * instance->lane_length + 1],
|
load_block(&instance->memory[l * instance->lane_length + 1],
|
||||||
blockhash_bytes);
|
blockhash_bytes);
|
||||||
|
@ -84,6 +84,15 @@ extern "C" {
|
|||||||
1 / !!(sizeof(blake2b_param) == sizeof(uint64_t) * CHAR_BIT)
|
1 / !!(sizeof(blake2b_param) == sizeof(uint64_t) * CHAR_BIT)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//randomx namespace
|
||||||
|
#define blake2b_init randomx_blake2b_init
|
||||||
|
#define blake2b_init_key randomx_blake2b_init_key
|
||||||
|
#define blake2b_init_param randomx_blake2b_init_param
|
||||||
|
#define blake2b_update randomx_blake2b_update
|
||||||
|
#define blake2b_final randomx_blake2b_final
|
||||||
|
#define blake2b randomx_blake2b
|
||||||
|
#define blake2b_long randomx_blake2b_long
|
||||||
|
|
||||||
/* Streaming API */
|
/* Streaming API */
|
||||||
int blake2b_init(blake2b_state *S, size_t outlen);
|
int blake2b_init(blake2b_state *S, size_t outlen);
|
||||||
int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
|
int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
|
||||||
@ -97,7 +106,7 @@ extern "C" {
|
|||||||
const void *key, size_t keylen);
|
const void *key, size_t keylen);
|
||||||
|
|
||||||
/* Argon2 Team - Begin Code */
|
/* Argon2 Team - Begin Code */
|
||||||
int rxa2_blake2b_long(void *out, size_t outlen, const void *in, size_t inlen);
|
int blake2b_long(void *out, size_t outlen, const void *in, size_t inlen);
|
||||||
/* Argon2 Team - End Code */
|
/* Argon2 Team - End Code */
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
@ -347,7 +347,7 @@ fail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Argon2 Team - Begin Code */
|
/* Argon2 Team - Begin Code */
|
||||||
int rxa2_blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen) {
|
int blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen) {
|
||||||
uint8_t *out = (uint8_t *)pout;
|
uint8_t *out = (uint8_t *)pout;
|
||||||
blake2b_state blake_state;
|
blake2b_state blake_state;
|
||||||
uint8_t outlen_bytes[sizeof(uint32_t)] = { 0 };
|
uint8_t outlen_bytes[sizeof(uint32_t)] = { 0 };
|
||||||
|
Loading…
Reference in New Issue
Block a user