1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-28 22:21:15 -07:00

Rename the remaining unprefixed functions

argon2_fill_first_blocks() can be static
This commit is contained in:
Frank Denis 2019-06-09 01:01:20 +02:00
parent 550622b04b
commit 7214dff083
3 changed files with 6 additions and 14 deletions
src/libsodium/crypto_pwhash/argon2

View File

@ -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);

View File

@ -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

View File

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