Skip to content

Commit

Permalink
Merge commit '7567cef' into MergeUpstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Doy-lee committed Jun 3, 2020
2 parents dd30a8d + 7567cef commit 70a24ce
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/argon2_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 + 4, l);
rxa2_blake2b_long(blockhash_bytes, ARGON2_BLOCK_SIZE, blockhash,
blake2b_long(blockhash_bytes, ARGON2_BLOCK_SIZE, blockhash,
ARGON2_PREHASH_SEED_LENGTH);
load_block(&instance->memory[l * instance->lane_length + 0],
blockhash_bytes);

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);
load_block(&instance->memory[l * instance->lane_length + 1],
blockhash_bytes);
Expand Down
11 changes: 10 additions & 1 deletion src/blake2/blake2.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ extern "C" {
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 */
int blake2b_init(blake2b_state *S, size_t outlen);
int blake2b_init_key(blake2b_state *S, size_t outlen, const void *key,
Expand All @@ -97,7 +106,7 @@ extern "C" {
const void *key, size_t keylen);

/* 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 */

#if defined(__cplusplus)
Expand Down
2 changes: 1 addition & 1 deletion src/blake2/blake2b.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ int blake2b(void *out, size_t outlen, const void *in, size_t inlen,
}

/* 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;
blake2b_state blake_state;
uint8_t outlen_bytes[sizeof(uint32_t)] = { 0 };
Expand Down
2 changes: 1 addition & 1 deletion src/tests/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int main(int argc, char** argv) {

store32(&seed, seedValue);

std::cout << "RandomX benchmark v1.1.4" << std::endl;
std::cout << "RandomX benchmark v1.1.5" << std::endl;

if (help || (!miningMode && !verificationMode)) {
printUsage(argv[0]);
Expand Down

0 comments on commit 70a24ce

Please sign in to comment.