mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Complete 08c0e03f83
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#ifndef crypto_pwhash_argon2i_H
|
||||
#define crypto_pwhash_argon2i_H
|
||||
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
@@ -16,27 +18,27 @@ extern "C" {
|
||||
SODIUM_EXPORT
|
||||
int crypto_pwhash_argon2i_alg_argon2i13(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_BYTES_MIN ARGON2_MIN_OUTLEN
|
||||
#define crypto_pwhash_argon2i_BYTES_MIN 16ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_bytes_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_BYTES_MAX ARGON2_MAX_OUTLEN
|
||||
#define crypto_pwhash_argon2i_BYTES_MAX 4294967295ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_bytes_max(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_PASSWD_MIN ARGON2_MIN_PWD_LENGTH
|
||||
#define crypto_pwhash_argon2i_PASSWD_MIN 0ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_passwd_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_PASSWD_MAX ARGON2_MAX_PWD_LENGTH
|
||||
#define crypto_pwhash_argon2i_PASSWD_MAX 4294967295ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_passwd_max(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_SALTBYTES 16U
|
||||
#define crypto_pwhash_argon2i_SALTBYTES 16ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_saltbytes(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_STRBYTES 128U
|
||||
#define crypto_pwhash_argon2i_STRBYTES 128ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_strbytes(void);
|
||||
|
||||
@@ -44,19 +46,19 @@ size_t crypto_pwhash_argon2i_strbytes(void);
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_pwhash_argon2i_strprefix(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_MIN ARGON2_MIN_TIME
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_MIN 3ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_opslimit_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_MAX ARGON2_MAX_TIME
|
||||
#define crypto_pwhash_argon2i_OPSLIMIT_MAX 4294967295ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_opslimit_max(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_MIN ARGON2_MIN_MEMORY
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_MIN 1
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_memlimit_min(void);
|
||||
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_MAX ARGON2_MAX_MEMORY
|
||||
#define crypto_pwhash_argon2i_MEMLIMIT_MAX ((SIZE_MAX >= 1ULL << 48) ? 4398046510080ULL : (SIZE_MAX >= 1ULL << 32) ? 2147483648ULL : 32768U)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_argon2i_memlimit_max(void);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef crypto_pwhash_scryptsalsa208sha256_H
|
||||
#define crypto_pwhash_scryptsalsa208sha256_H
|
||||
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -13,19 +14,19 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_BYTES_MIN // XXX
|
||||
#define crypto_pwhash_scryptsalsa208sha256_BYTES_MIN 1
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_bytes_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_BYTES_MAX // XXX
|
||||
#define crypto_pwhash_scryptsalsa208sha256_BYTES_MAX SIZE_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_bytes_max(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN // XXX
|
||||
#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN 0
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_passwd_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX // XXX
|
||||
#define crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX SIZE_MAX
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_passwd_max(void);
|
||||
|
||||
@@ -41,19 +42,19 @@ size_t crypto_pwhash_scryptsalsa208sha256_strbytes(void);
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_pwhash_scryptsalsa208sha256_strprefix(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX // XXX
|
||||
#define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX 18446744073709551615ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN // XXX
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN 16777216ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min(void);
|
||||
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX // XXX
|
||||
#define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX 18446744073709551615ULL
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max(void);
|
||||
|
||||
|
||||
@@ -321,9 +321,8 @@ int main(void)
|
||||
printf("pwhash_str_verify(invalid(9)) failure\n");
|
||||
}
|
||||
assert(crypto_pwhash_bytes_min() > 0U);
|
||||
assert(crypto_pwhash_bytes_max() > 0U);
|
||||
assert(crypto_pwhash_passwd_min() > 0U);
|
||||
assert(crypto_pwhash_passwd_max() > 0U);
|
||||
assert(crypto_pwhash_bytes_max() > crypto_pwhash_bytes_min());
|
||||
assert(crypto_pwhash_passwd_max() > crypto_pwhash_passwd_min());
|
||||
assert(crypto_pwhash_saltbytes() > 0U);
|
||||
assert(crypto_pwhash_strbytes() > 1U);
|
||||
assert(crypto_pwhash_strbytes() > strlen(crypto_pwhash_strprefix()));
|
||||
|
||||
@@ -331,9 +331,8 @@ int main(void)
|
||||
|
||||
assert(str_out[crypto_pwhash_scryptsalsa208sha256_STRBYTES - 1U] == 0);
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_bytes_min() > 0U);
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_bytes_max() > 0U);
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_passwd_min() > 0U);
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_passwd_max() > 0U);
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_bytes_max() > crypto_pwhash_scryptsalsa208sha256_bytes_min());
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_passwd_max() > crypto_pwhash_scryptsalsa208sha256_passwd_min());
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_saltbytes() > 0U);
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_strbytes() > 1U);
|
||||
assert(crypto_pwhash_scryptsalsa208sha256_strbytes() >
|
||||
|
||||
Reference in New Issue
Block a user