V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 42s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 42s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -13,15 +13,41 @@
|
||||
guard_sourcing
|
||||
|
||||
#######################################
|
||||
# Benchmark cryptsetup KDF to determine pbkdf-memory and pbkdf-force-iterations
|
||||
# Benchmark cryptsetup KDF to determine pbkdf-memory and pbkdf-force-iterations for given pbkdf-threads.
|
||||
# Globals:
|
||||
# VAR_ITER_TIME
|
||||
# VAR_KDF_ITERATIONS
|
||||
# VAR_KDF_MEMORY
|
||||
# VAR_KDF_THREADS
|
||||
# VAR_RECIPE_STRING
|
||||
# VAR_SETUP_PART
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
benchmarking_encryption() {
|
||||
declare var_result=""
|
||||
# shellcheck disable=SC2155
|
||||
declare -girx VAR_KDF_THREADS=$(yq_val ".recipe.${VAR_RECIPE_STRING}.control.kdf.threads" "${VAR_SETUP_PART}")
|
||||
# shellcheck disable=SC2155
|
||||
declare -girx VAR_ITER_TIME=$(yq_val ".recipe.${VAR_RECIPE_STRING}.control.kdf.time" "${VAR_SETUP_PART}")
|
||||
|
||||
echo "BENCHMARK CRYPTSETUP ARGON2ID KDF PARAMETER"
|
||||
# shellcheck disable=SC2312
|
||||
var_result=$(cryptsetup benchmark --pbkdf argon2id --iter-time "${VAR_ITER_TIME:-3000}" --pbkdf-parallel "${VAR_KDF_THREADS:-1}" 2>/dev/null \
|
||||
| grep -E '^argon2id[[:space:]]+[0-9]+[[:space:]]+iterations')
|
||||
|
||||
echo "${var_result}"
|
||||
|
||||
do_log "info" "file_only" "3210() [cryptsetup benchmark --pbkdf argon2id --iter-time ${VAR_ITER_TIME:-3000} --pbkdf-parallel ${VAR_KDF_THREADS:-1}]."
|
||||
do_log "info" "file_only" "3210() Results: [${var_result}]."
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
declare -girx VAR_KDF_ITERATIONS=$(awk '{print $2}' <<<"${var_result}")
|
||||
# shellcheck disable=SC2155
|
||||
declare -girx VAR_KDF_MEMORY=$(awk -F'[ ,]+' '{print $4}' <<<"${var_result}")
|
||||
|
||||
:
|
||||
return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user