Warning, file /include/sodium/crypto_pwhash_scryptsalsa208sha256.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #ifndef crypto_pwhash_scryptsalsa208sha256_H
0002 #define crypto_pwhash_scryptsalsa208sha256_H
0003
0004 #include <limits.h>
0005 #include <stddef.h>
0006 #include <stdint.h>
0007
0008 #include "export.h"
0009
0010 #ifdef __cplusplus
0011 # ifdef __GNUC__
0012 # pragma GCC diagnostic ignored "-Wlong-long"
0013 # endif
0014 extern "C" {
0015 #endif
0016
0017 #define crypto_pwhash_scryptsalsa208sha256_BYTES_MIN 16U
0018 SODIUM_EXPORT
0019 size_t crypto_pwhash_scryptsalsa208sha256_bytes_min(void);
0020
0021 #define crypto_pwhash_scryptsalsa208sha256_BYTES_MAX \
0022 SODIUM_MIN(SODIUM_SIZE_MAX, 0x1fffffffe0ULL)
0023 SODIUM_EXPORT
0024 size_t crypto_pwhash_scryptsalsa208sha256_bytes_max(void);
0025
0026 #define crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN 0U
0027 SODIUM_EXPORT
0028 size_t crypto_pwhash_scryptsalsa208sha256_passwd_min(void);
0029
0030 #define crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX SODIUM_SIZE_MAX
0031 SODIUM_EXPORT
0032 size_t crypto_pwhash_scryptsalsa208sha256_passwd_max(void);
0033
0034 #define crypto_pwhash_scryptsalsa208sha256_SALTBYTES 32U
0035 SODIUM_EXPORT
0036 size_t crypto_pwhash_scryptsalsa208sha256_saltbytes(void);
0037
0038 #define crypto_pwhash_scryptsalsa208sha256_STRBYTES 102U
0039 SODIUM_EXPORT
0040 size_t crypto_pwhash_scryptsalsa208sha256_strbytes(void);
0041
0042 #define crypto_pwhash_scryptsalsa208sha256_STRPREFIX "$7$"
0043 SODIUM_EXPORT
0044 const char *crypto_pwhash_scryptsalsa208sha256_strprefix(void);
0045
0046 #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN 32768U
0047 SODIUM_EXPORT
0048 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min(void);
0049
0050 #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX 4294967295U
0051 SODIUM_EXPORT
0052 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max(void);
0053
0054 #define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN 16777216U
0055 SODIUM_EXPORT
0056 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min(void);
0057
0058 #define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX \
0059 SODIUM_MIN(SIZE_MAX, 68719476736ULL)
0060 SODIUM_EXPORT
0061 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max(void);
0062
0063 #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE 524288U
0064 SODIUM_EXPORT
0065 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive(void);
0066
0067 #define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE 16777216U
0068 SODIUM_EXPORT
0069 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive(void);
0070
0071 #define crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE 33554432U
0072 SODIUM_EXPORT
0073 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive(void);
0074
0075 #define crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE 1073741824U
0076 SODIUM_EXPORT
0077 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive(void);
0078
0079 SODIUM_EXPORT
0080 int crypto_pwhash_scryptsalsa208sha256(unsigned char * const out,
0081 unsigned long long outlen,
0082 const char * const passwd,
0083 unsigned long long passwdlen,
0084 const unsigned char * const salt,
0085 unsigned long long opslimit,
0086 size_t memlimit)
0087 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0088
0089 SODIUM_EXPORT
0090 int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
0091 const char * const passwd,
0092 unsigned long long passwdlen,
0093 unsigned long long opslimit,
0094 size_t memlimit)
0095 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0096
0097 SODIUM_EXPORT
0098 int crypto_pwhash_scryptsalsa208sha256_str_verify(const char * str,
0099 const char * const passwd,
0100 unsigned long long passwdlen)
0101 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0102
0103 SODIUM_EXPORT
0104 int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd, size_t passwdlen,
0105 const uint8_t * salt, size_t saltlen,
0106 uint64_t N, uint32_t r, uint32_t p,
0107 uint8_t * buf, size_t buflen)
0108 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0109
0110 SODIUM_EXPORT
0111 int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char * str,
0112 unsigned long long opslimit,
0113 size_t memlimit)
0114 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0115
0116 #ifdef __cplusplus
0117 }
0118 #endif
0119
0120 #endif