diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c index ef32287b..4d8be093 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c @@ -109,7 +109,7 @@ void 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 = (instance->type == Argon2_i); + int data_independent_addressing; /* Pseudo-random values that determine the reference block position */ uint64_t *pseudo_rands = NULL; @@ -117,6 +117,8 @@ void fill_segment_ref(const argon2_instance_t *instance, return; } + data_independent_addressing = (instance->type == Argon2_i); + pseudo_rands = (uint64_t *)malloc(sizeof(uint64_t) * (instance->segment_length)); diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c index 519b884a..e4565aae 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c @@ -101,7 +101,7 @@ void 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 = (instance->type == Argon2_i); + int data_independent_addressing; /* Pseudo-random values that determine the reference block position */ uint64_t *pseudo_rands = NULL; @@ -110,6 +110,8 @@ void fill_segment_ssse3(const argon2_instance_t *instance, return; } + data_independent_addressing = (instance->type == Argon2_i); + pseudo_rands = (uint64_t *)malloc(sizeof(uint64_t) * instance->segment_length); if (pseudo_rands == NULL) {