1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 10:37:24 -07:00

Initialize the argon2 position structure a bit earlier

This commit is contained in:
Frank Denis 2017-11-08 12:55:58 +01:00
parent 8ab638b983
commit 40070b342a

View File

@ -290,21 +290,19 @@ index_alpha(const argon2_instance_t *instance,
void void
fill_memory_blocks(argon2_instance_t *instance, uint32_t pass) fill_memory_blocks(argon2_instance_t *instance, uint32_t pass)
{ {
argon2_position_t position;
uint32_t l;
uint32_t s; uint32_t s;
if (instance == NULL || instance->lanes == 0) { if (instance == NULL || instance->lanes == 0) {
return; /* LCOV_EXCL_LINE */ return; /* LCOV_EXCL_LINE */
} }
position.pass = pass;
for (s = 0; s < ARGON2_SYNC_POINTS; ++s) { for (s = 0; s < ARGON2_SYNC_POINTS; ++s) {
uint32_t l; position.slice = (uint8_t) s;
for (l = 0; l < instance->lanes; ++l) { for (l = 0; l < instance->lanes; ++l) {
argon2_position_t position;
position.pass = pass;
position.lane = l; position.lane = l;
position.slice = (uint8_t) s;
position.index = 0; position.index = 0;
fill_segment(instance, position); fill_segment(instance, position);
} }