From 0cb4db084ff6e9d2711e2568e1022a99e1325f78 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 3 Jun 2020 17:33:18 +0200 Subject: [PATCH] Use unsigned long long for opslimit Fixes #966 --- src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c | 10 +++++----- src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c | 10 +++++----- src/libsodium/crypto_pwhash/crypto_pwhash.c | 10 +++++----- .../scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c | 8 ++++---- src/libsodium/include/sodium/crypto_pwhash.h | 10 +++++----- src/libsodium/include/sodium/crypto_pwhash_argon2i.h | 10 +++++----- src/libsodium/include/sodium/crypto_pwhash_argon2id.h | 10 +++++----- .../sodium/crypto_pwhash_scryptsalsa208sha256.h | 8 ++++---- 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c index 685fa03a..ee50c09f 100644 --- a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +++ b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c @@ -72,14 +72,14 @@ crypto_pwhash_argon2i_strprefix(void) return crypto_pwhash_argon2i_STRPREFIX; } -size_t +unsigned long long crypto_pwhash_argon2i_opslimit_min(void) { COMPILER_ASSERT(crypto_pwhash_argon2i_OPSLIMIT_MIN >= ARGON2_MIN_TIME); return crypto_pwhash_argon2i_OPSLIMIT_MIN; } -size_t +unsigned long long crypto_pwhash_argon2i_opslimit_max(void) { COMPILER_ASSERT(crypto_pwhash_argon2i_OPSLIMIT_MAX <= ARGON2_MAX_TIME); @@ -100,7 +100,7 @@ crypto_pwhash_argon2i_memlimit_max(void) return crypto_pwhash_argon2i_MEMLIMIT_MAX; } -size_t +unsigned long long crypto_pwhash_argon2i_opslimit_interactive(void) { return crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE; @@ -112,7 +112,7 @@ crypto_pwhash_argon2i_memlimit_interactive(void) return crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE; } -size_t +unsigned long long crypto_pwhash_argon2i_opslimit_moderate(void) { return crypto_pwhash_argon2i_OPSLIMIT_MODERATE; @@ -124,7 +124,7 @@ crypto_pwhash_argon2i_memlimit_moderate(void) return crypto_pwhash_argon2i_MEMLIMIT_MODERATE; } -size_t +unsigned long long crypto_pwhash_argon2i_opslimit_sensitive(void) { return crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE; diff --git a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c index 99d3e219..55556d03 100644 --- a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c +++ b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c @@ -68,14 +68,14 @@ crypto_pwhash_argon2id_strprefix(void) return crypto_pwhash_argon2id_STRPREFIX; } -size_t +unsigned long long crypto_pwhash_argon2id_opslimit_min(void) { COMPILER_ASSERT(crypto_pwhash_argon2id_OPSLIMIT_MIN >= ARGON2_MIN_TIME); return crypto_pwhash_argon2id_OPSLIMIT_MIN; } -size_t +unsigned long long crypto_pwhash_argon2id_opslimit_max(void) { COMPILER_ASSERT(crypto_pwhash_argon2id_OPSLIMIT_MAX <= ARGON2_MAX_TIME); @@ -96,7 +96,7 @@ crypto_pwhash_argon2id_memlimit_max(void) return crypto_pwhash_argon2id_MEMLIMIT_MAX; } -size_t +unsigned long long crypto_pwhash_argon2id_opslimit_interactive(void) { return crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE; @@ -108,7 +108,7 @@ crypto_pwhash_argon2id_memlimit_interactive(void) return crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE; } -size_t +unsigned long long crypto_pwhash_argon2id_opslimit_moderate(void) { return crypto_pwhash_argon2id_OPSLIMIT_MODERATE; @@ -120,7 +120,7 @@ crypto_pwhash_argon2id_memlimit_moderate(void) return crypto_pwhash_argon2id_MEMLIMIT_MODERATE; } -size_t +unsigned long long crypto_pwhash_argon2id_opslimit_sensitive(void) { return crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE; diff --git a/src/libsodium/crypto_pwhash/crypto_pwhash.c b/src/libsodium/crypto_pwhash/crypto_pwhash.c index a229b9f7..c1659f7b 100644 --- a/src/libsodium/crypto_pwhash/crypto_pwhash.c +++ b/src/libsodium/crypto_pwhash/crypto_pwhash.c @@ -65,13 +65,13 @@ crypto_pwhash_strprefix(void) return crypto_pwhash_STRPREFIX; } -size_t +unsigned long long crypto_pwhash_opslimit_min(void) { return crypto_pwhash_OPSLIMIT_MIN; } -size_t +unsigned long long crypto_pwhash_opslimit_max(void) { return crypto_pwhash_OPSLIMIT_MAX; @@ -89,7 +89,7 @@ crypto_pwhash_memlimit_max(void) return crypto_pwhash_MEMLIMIT_MAX; } -size_t +unsigned long long crypto_pwhash_opslimit_interactive(void) { return crypto_pwhash_OPSLIMIT_INTERACTIVE; @@ -101,7 +101,7 @@ crypto_pwhash_memlimit_interactive(void) return crypto_pwhash_MEMLIMIT_INTERACTIVE; } -size_t +unsigned long long crypto_pwhash_opslimit_moderate(void) { return crypto_pwhash_OPSLIMIT_MODERATE; @@ -113,7 +113,7 @@ crypto_pwhash_memlimit_moderate(void) return crypto_pwhash_MEMLIMIT_MODERATE; } -size_t +unsigned long long crypto_pwhash_opslimit_sensitive(void) { return crypto_pwhash_OPSLIMIT_SENSITIVE; diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c index b77588fa..6ebc4629 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c @@ -105,13 +105,13 @@ crypto_pwhash_scryptsalsa208sha256_strprefix(void) return crypto_pwhash_scryptsalsa208sha256_STRPREFIX; } -size_t +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_min(void) { return crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN; } -size_t +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_max(void) { return crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX; @@ -129,7 +129,7 @@ crypto_pwhash_scryptsalsa208sha256_memlimit_max(void) return crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX; } -size_t +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void) { return crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE; @@ -141,7 +141,7 @@ crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(void) return crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE; } -size_t +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void) { return crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE; diff --git a/src/libsodium/include/sodium/crypto_pwhash.h b/src/libsodium/include/sodium/crypto_pwhash.h index 585a993e..bc01d150 100644 --- a/src/libsodium/include/sodium/crypto_pwhash.h +++ b/src/libsodium/include/sodium/crypto_pwhash.h @@ -56,11 +56,11 @@ const char *crypto_pwhash_strprefix(void); #define crypto_pwhash_OPSLIMIT_MIN crypto_pwhash_argon2id_OPSLIMIT_MIN SODIUM_EXPORT -size_t crypto_pwhash_opslimit_min(void); +unsigned long long crypto_pwhash_opslimit_min(void); #define crypto_pwhash_OPSLIMIT_MAX crypto_pwhash_argon2id_OPSLIMIT_MAX SODIUM_EXPORT -size_t crypto_pwhash_opslimit_max(void); +unsigned long long crypto_pwhash_opslimit_max(void); #define crypto_pwhash_MEMLIMIT_MIN crypto_pwhash_argon2id_MEMLIMIT_MIN SODIUM_EXPORT @@ -72,7 +72,7 @@ size_t crypto_pwhash_memlimit_max(void); #define crypto_pwhash_OPSLIMIT_INTERACTIVE crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE SODIUM_EXPORT -size_t crypto_pwhash_opslimit_interactive(void); +unsigned long long crypto_pwhash_opslimit_interactive(void); #define crypto_pwhash_MEMLIMIT_INTERACTIVE crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE SODIUM_EXPORT @@ -80,7 +80,7 @@ size_t crypto_pwhash_memlimit_interactive(void); #define crypto_pwhash_OPSLIMIT_MODERATE crypto_pwhash_argon2id_OPSLIMIT_MODERATE SODIUM_EXPORT -size_t crypto_pwhash_opslimit_moderate(void); +unsigned long long crypto_pwhash_opslimit_moderate(void); #define crypto_pwhash_MEMLIMIT_MODERATE crypto_pwhash_argon2id_MEMLIMIT_MODERATE SODIUM_EXPORT @@ -88,7 +88,7 @@ size_t crypto_pwhash_memlimit_moderate(void); #define crypto_pwhash_OPSLIMIT_SENSITIVE crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE SODIUM_EXPORT -size_t crypto_pwhash_opslimit_sensitive(void); +unsigned long long crypto_pwhash_opslimit_sensitive(void); #define crypto_pwhash_MEMLIMIT_SENSITIVE crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_pwhash_argon2i.h b/src/libsodium/include/sodium/crypto_pwhash_argon2i.h index 88ff6221..53e76148 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +++ b/src/libsodium/include/sodium/crypto_pwhash_argon2i.h @@ -48,11 +48,11 @@ const char *crypto_pwhash_argon2i_strprefix(void); #define crypto_pwhash_argon2i_OPSLIMIT_MIN 3U SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_min(void); +unsigned long long crypto_pwhash_argon2i_opslimit_min(void); #define crypto_pwhash_argon2i_OPSLIMIT_MAX 4294967295U SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_max(void); +unsigned long long crypto_pwhash_argon2i_opslimit_max(void); #define crypto_pwhash_argon2i_MEMLIMIT_MIN 8192U SODIUM_EXPORT @@ -65,7 +65,7 @@ size_t crypto_pwhash_argon2i_memlimit_max(void); #define crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE 4U SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_interactive(void); +unsigned long long crypto_pwhash_argon2i_opslimit_interactive(void); #define crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE 33554432U SODIUM_EXPORT @@ -73,7 +73,7 @@ size_t crypto_pwhash_argon2i_memlimit_interactive(void); #define crypto_pwhash_argon2i_OPSLIMIT_MODERATE 6U SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_moderate(void); +unsigned long long crypto_pwhash_argon2i_opslimit_moderate(void); #define crypto_pwhash_argon2i_MEMLIMIT_MODERATE 134217728U SODIUM_EXPORT @@ -81,7 +81,7 @@ size_t crypto_pwhash_argon2i_memlimit_moderate(void); #define crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE 8U SODIUM_EXPORT -size_t crypto_pwhash_argon2i_opslimit_sensitive(void); +unsigned long long crypto_pwhash_argon2i_opslimit_sensitive(void); #define crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE 536870912U SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_pwhash_argon2id.h b/src/libsodium/include/sodium/crypto_pwhash_argon2id.h index 7183abd1..7cb651a4 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +++ b/src/libsodium/include/sodium/crypto_pwhash_argon2id.h @@ -48,11 +48,11 @@ const char *crypto_pwhash_argon2id_strprefix(void); #define crypto_pwhash_argon2id_OPSLIMIT_MIN 1U SODIUM_EXPORT -size_t crypto_pwhash_argon2id_opslimit_min(void); +unsigned long long crypto_pwhash_argon2id_opslimit_min(void); #define crypto_pwhash_argon2id_OPSLIMIT_MAX 4294967295U SODIUM_EXPORT -size_t crypto_pwhash_argon2id_opslimit_max(void); +unsigned long long crypto_pwhash_argon2id_opslimit_max(void); #define crypto_pwhash_argon2id_MEMLIMIT_MIN 8192U SODIUM_EXPORT @@ -65,7 +65,7 @@ size_t crypto_pwhash_argon2id_memlimit_max(void); #define crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE 2U SODIUM_EXPORT -size_t crypto_pwhash_argon2id_opslimit_interactive(void); +unsigned long long crypto_pwhash_argon2id_opslimit_interactive(void); #define crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE 67108864U SODIUM_EXPORT @@ -73,7 +73,7 @@ size_t crypto_pwhash_argon2id_memlimit_interactive(void); #define crypto_pwhash_argon2id_OPSLIMIT_MODERATE 3U SODIUM_EXPORT -size_t crypto_pwhash_argon2id_opslimit_moderate(void); +unsigned long long crypto_pwhash_argon2id_opslimit_moderate(void); #define crypto_pwhash_argon2id_MEMLIMIT_MODERATE 268435456U SODIUM_EXPORT @@ -81,7 +81,7 @@ size_t crypto_pwhash_argon2id_memlimit_moderate(void); #define crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE 4U SODIUM_EXPORT -size_t crypto_pwhash_argon2id_opslimit_sensitive(void); +unsigned long long crypto_pwhash_argon2id_opslimit_sensitive(void); #define crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE 1073741824U SODIUM_EXPORT diff --git a/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h b/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h index 5c0bf7d3..db6c0cca 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +++ b/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h @@ -45,11 +45,11 @@ const char *crypto_pwhash_scryptsalsa208sha256_strprefix(void); #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768U SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min(void); +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_min(void); #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX 4294967295U SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max(void); +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_max(void); #define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN 16777216U SODIUM_EXPORT @@ -62,7 +62,7 @@ size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max(void); #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE 524288U SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void); +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void); #define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE 16777216U SODIUM_EXPORT @@ -70,7 +70,7 @@ size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(void); #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE 33554432U SODIUM_EXPORT -size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void); +unsigned long long crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void); #define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE 1073741824U SODIUM_EXPORT