1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

We only support data independent addressing for Argon2

Let the compiler automatically remove unused code
This commit is contained in:
Frank Denis 2016-03-11 16:41:06 +01:00
parent 5a00dff84d
commit 630ac0913b
2 changed files with 2 additions and 6 deletions

View File

@ -111,7 +111,7 @@ int fill_segment_ref(const argon2_instance_t *instance,
uint32_t prev_offset, curr_offset;
uint32_t starting_index;
uint32_t i;
int data_independent_addressing;
const int data_independent_addressing = 1; /* instance->type == Argon2_i */
/* Pseudo-random values that determine the reference block position */
uint64_t *pseudo_rands = NULL;
@ -119,8 +119,6 @@ int fill_segment_ref(const argon2_instance_t *instance,
return ARGON2_OK;
}
data_independent_addressing = (instance->type == Argon2_i);
pseudo_rands =
(uint64_t *)malloc(sizeof(uint64_t) * (instance->segment_length));

View File

@ -105,7 +105,7 @@ int fill_segment_ssse3(const argon2_instance_t *instance,
uint32_t prev_offset, curr_offset;
uint32_t starting_index, i;
__m128i state[64];
int data_independent_addressing;
const int data_independent_addressing = 1; /* instance->type == Argon2_i */
/* Pseudo-random values that determine the reference block position */
uint64_t *pseudo_rands = NULL;
@ -114,8 +114,6 @@ int fill_segment_ssse3(const argon2_instance_t *instance,
return ARGON2_OK;
}
data_independent_addressing = (instance->type == Argon2_i);
pseudo_rands =
(uint64_t *)malloc(sizeof(uint64_t) * instance->segment_length);
if (pseudo_rands == NULL) {