From 7214dff083638604cd48e5c9ffc5704460192794 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 9 Jun 2019 01:01:20 +0200 Subject: [PATCH] Rename the remaining unprefixed functions argon2_fill_first_blocks() can be static --- src/libsodium/crypto_pwhash/argon2/argon2-core.c | 8 ++++---- src/libsodium/crypto_pwhash/argon2/argon2-core.h | 10 +--------- src/libsodium/crypto_pwhash/argon2/argon2.c | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c index d3c1eaea..8f89e97c 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c @@ -223,7 +223,7 @@ argon2_finalize(const argon2_context *context, argon2_instance_t *instance) } void -fill_memory_blocks(argon2_instance_t *instance, uint32_t pass) +argon2_fill_memory_blocks(argon2_instance_t *instance, uint32_t pass) { argon2_position_t position; uint32_t l; @@ -369,8 +369,8 @@ argon2_validate_inputs(const argon2_context *context) return ARGON2_OK; } -void -fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance) +static void +argon2_fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance) { uint32_t l; /* Make the first and second block in each lane as G(H0||i||0) or @@ -511,7 +511,7 @@ argon2_initialize(argon2_instance_t *instance, argon2_context *context) /* 3. Creating first blocks, we always have at least two blocks in a slice */ - fill_first_blocks(blockhash, instance); + argon2_fill_first_blocks(blockhash, instance); /* Clearing the hash */ sodium_memzero(blockhash, ARGON2_PREHASH_SEED_LENGTH); diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.h b/src/libsodium/crypto_pwhash/argon2/argon2-core.h index 3abf6f33..ccad1355 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.h +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.h @@ -216,14 +216,6 @@ static uint32_t index_alpha(const argon2_instance_t *instance, */ int argon2_validate_inputs(const argon2_context *context); -/* - * Function creates first 2 blocks per lane - * @param instance Pointer to the current instance - * @param blockhash Pointer to the pre-hashing digest - * @pre blockhash must point to @a PREHASH_SEED_LENGTH allocated values - */ -void fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance); - /* * Function allocates memory, hashes the inputs with Blake, and creates first * two blocks. Returns the pointer to the main memory with 2 blocks per lane @@ -275,6 +267,6 @@ void argon2_fill_segment_ref(const argon2_instance_t *instance, * @param instance Pointer to the current instance * @return Zero if successful, -1 if memory failed to allocate */ -void fill_memory_blocks(argon2_instance_t *instance, uint32_t pass); +void argon2_fill_memory_blocks(argon2_instance_t *instance, uint32_t pass); #endif diff --git a/src/libsodium/crypto_pwhash/argon2/argon2.c b/src/libsodium/crypto_pwhash/argon2/argon2.c index ba075a28..b3bee574 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2.c @@ -73,7 +73,7 @@ argon2_ctx(argon2_context *context, argon2_type type) /* 4. Filling memory */ for (pass = 0; pass < instance.passes; pass++) { - fill_memory_blocks(&instance, pass); + argon2_fill_memory_blocks(&instance, pass); } /* 5. Finalization */