From 550622b04b8d8641ef90a98f66b9781ec5b6df32 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 9 Jun 2019 00:19:41 +0200 Subject: [PATCH] Rename fill_segment_* to argon2_fill_segment_* --- src/libsodium/crypto_pwhash/argon2/argon2-core.c | 10 +++++----- src/libsodium/crypto_pwhash/argon2/argon2-core.h | 16 ++++++++-------- .../argon2/argon2-fill-block-avx2.c | 4 ++-- .../argon2/argon2-fill-block-avx512f.c | 4 ++-- .../crypto_pwhash/argon2/argon2-fill-block-ref.c | 3 ++- .../argon2/argon2-fill-block-ssse3.c | 4 ++-- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c index fbf286cc..d3c1eaea 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c @@ -45,7 +45,7 @@ # define MAP_POPULATE 0 #endif -static fill_segment_fn fill_segment = fill_segment_ref; +static fill_segment_fn fill_segment = argon2_fill_segment_ref; static void load_block(block *dst, const void *input) @@ -525,24 +525,24 @@ argon2_pick_best_implementation(void) #if defined(HAVE_AVX512FINTRIN_H) && defined(HAVE_AVX2INTRIN_H) && \ defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) if (sodium_runtime_has_avx512f()) { - fill_segment = fill_segment_avx512f; + fill_segment = argon2_fill_segment_avx512f; return 0; } #endif #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_TMMINTRIN_H) && \ defined(HAVE_SMMINTRIN_H) if (sodium_runtime_has_avx2()) { - fill_segment = fill_segment_avx2; + fill_segment = argon2_fill_segment_avx2; return 0; } #endif #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) if (sodium_runtime_has_ssse3()) { - fill_segment = fill_segment_ssse3; + fill_segment = argon2_fill_segment_ssse3; return 0; } #endif - fill_segment = fill_segment_ref; + fill_segment = argon2_fill_segment_ref; return 0; /* LCOV_EXCL_STOP */ diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.h b/src/libsodium/crypto_pwhash/argon2/argon2-core.h index a5779041..3abf6f33 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.h +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.h @@ -260,14 +260,14 @@ void argon2_finalize(const argon2_context *context, typedef void (*fill_segment_fn)(const argon2_instance_t *instance, argon2_position_t position); int argon2_pick_best_implementation(void); -void fill_segment_avx512f(const argon2_instance_t *instance, - argon2_position_t position); -void fill_segment_avx2(const argon2_instance_t *instance, - argon2_position_t position); -void fill_segment_ssse3(const argon2_instance_t *instance, - argon2_position_t position); -void fill_segment_ref(const argon2_instance_t *instance, - argon2_position_t position); +void argon2_fill_segment_avx512f(const argon2_instance_t *instance, + argon2_position_t position); +void argon2_fill_segment_avx2(const argon2_instance_t *instance, + argon2_position_t position); +void argon2_fill_segment_ssse3(const argon2_instance_t *instance, + argon2_position_t position); +void argon2_fill_segment_ref(const argon2_instance_t *instance, + argon2_position_t position); /* * Function that fills the entire memory t_cost times based on the first two diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c index 8acb42ca..ab400ded 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c @@ -141,8 +141,8 @@ generate_addresses(const argon2_instance_t *instance, } void -fill_segment_avx2(const argon2_instance_t *instance, - argon2_position_t position) +argon2_fill_segment_avx2(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; uint64_t pseudo_rand, ref_index, ref_lane; diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c index 1f1ec8b3..d0d7c8c8 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c @@ -146,8 +146,8 @@ generate_addresses(const argon2_instance_t *instance, } void -fill_segment_avx512f(const argon2_instance_t *instance, - argon2_position_t position) +argon2_fill_segment_avx512f(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; uint64_t pseudo_rand, ref_index, ref_lane; 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 75e8d8f5..567895d8 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c @@ -141,7 +141,8 @@ generate_addresses(const argon2_instance_t *instance, } void -fill_segment_ref(const argon2_instance_t *instance, argon2_position_t position) +argon2_fill_segment_ref(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; /* Pseudo-random values that determine the reference block position */ 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 796c4455..36eac24f 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c @@ -140,8 +140,8 @@ generate_addresses(const argon2_instance_t *instance, } void -fill_segment_ssse3(const argon2_instance_t *instance, - argon2_position_t position) +argon2_fill_segment_ssse3(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; uint64_t pseudo_rand, ref_index, ref_lane;