Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:40

0001 #ifndef crypto_pwhash_argon2i_H
0002 #define crypto_pwhash_argon2i_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_argon2i_ALG_ARGON2I13 1
0018 SODIUM_EXPORT
0019 int crypto_pwhash_argon2i_alg_argon2i13(void);
0020 
0021 #define crypto_pwhash_argon2i_BYTES_MIN 16U
0022 SODIUM_EXPORT
0023 size_t crypto_pwhash_argon2i_bytes_min(void);
0024 
0025 #define crypto_pwhash_argon2i_BYTES_MAX SODIUM_MIN(SODIUM_SIZE_MAX, 4294967295U)
0026 SODIUM_EXPORT
0027 size_t crypto_pwhash_argon2i_bytes_max(void);
0028 
0029 #define crypto_pwhash_argon2i_PASSWD_MIN 0U
0030 SODIUM_EXPORT
0031 size_t crypto_pwhash_argon2i_passwd_min(void);
0032 
0033 #define crypto_pwhash_argon2i_PASSWD_MAX 4294967295U
0034 SODIUM_EXPORT
0035 size_t crypto_pwhash_argon2i_passwd_max(void);
0036 
0037 #define crypto_pwhash_argon2i_SALTBYTES 16U
0038 SODIUM_EXPORT
0039 size_t crypto_pwhash_argon2i_saltbytes(void);
0040 
0041 #define crypto_pwhash_argon2i_STRBYTES 128U
0042 SODIUM_EXPORT
0043 size_t crypto_pwhash_argon2i_strbytes(void);
0044 
0045 #define crypto_pwhash_argon2i_STRPREFIX "$argon2i$"
0046 SODIUM_EXPORT
0047 const char *crypto_pwhash_argon2i_strprefix(void);
0048 
0049 #define crypto_pwhash_argon2i_OPSLIMIT_MIN 3U
0050 SODIUM_EXPORT
0051 size_t crypto_pwhash_argon2i_opslimit_min(void);
0052 
0053 #define crypto_pwhash_argon2i_OPSLIMIT_MAX 4294967295U
0054 SODIUM_EXPORT
0055 size_t crypto_pwhash_argon2i_opslimit_max(void);
0056 
0057 #define crypto_pwhash_argon2i_MEMLIMIT_MIN 8192U
0058 SODIUM_EXPORT
0059 size_t crypto_pwhash_argon2i_memlimit_min(void);
0060 
0061 #define crypto_pwhash_argon2i_MEMLIMIT_MAX \
0062     ((SIZE_MAX >= 4398046510080U) ? 4398046510080U : (SIZE_MAX >= 2147483648U) ? 2147483648U : 32768U)
0063 SODIUM_EXPORT
0064 size_t crypto_pwhash_argon2i_memlimit_max(void);
0065 
0066 #define crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE 4U
0067 SODIUM_EXPORT
0068 size_t crypto_pwhash_argon2i_opslimit_interactive(void);
0069 
0070 #define crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE 33554432U
0071 SODIUM_EXPORT
0072 size_t crypto_pwhash_argon2i_memlimit_interactive(void);
0073 
0074 #define crypto_pwhash_argon2i_OPSLIMIT_MODERATE 6U
0075 SODIUM_EXPORT
0076 size_t crypto_pwhash_argon2i_opslimit_moderate(void);
0077 
0078 #define crypto_pwhash_argon2i_MEMLIMIT_MODERATE 134217728U
0079 SODIUM_EXPORT
0080 size_t crypto_pwhash_argon2i_memlimit_moderate(void);
0081 
0082 #define crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE 8U
0083 SODIUM_EXPORT
0084 size_t crypto_pwhash_argon2i_opslimit_sensitive(void);
0085 
0086 #define crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE 536870912U
0087 SODIUM_EXPORT
0088 size_t crypto_pwhash_argon2i_memlimit_sensitive(void);
0089 
0090 SODIUM_EXPORT
0091 int crypto_pwhash_argon2i(unsigned char * const out,
0092                           unsigned long long outlen,
0093                           const char * const passwd,
0094                           unsigned long long passwdlen,
0095                           const unsigned char * const salt,
0096                           unsigned long long opslimit, size_t memlimit,
0097                           int alg)
0098             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0099 
0100 SODIUM_EXPORT
0101 int crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES],
0102                               const char * const passwd,
0103                               unsigned long long passwdlen,
0104                               unsigned long long opslimit, size_t memlimit)
0105             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0106 
0107 SODIUM_EXPORT
0108 int crypto_pwhash_argon2i_str_verify(const char * str,
0109                                      const char * const passwd,
0110                                      unsigned long long passwdlen)
0111             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0112 
0113 SODIUM_EXPORT
0114 int crypto_pwhash_argon2i_str_needs_rehash(const char * str,
0115                                            unsigned long long opslimit, size_t memlimit)
0116             __attribute__ ((warn_unused_result))  __attribute__ ((nonnull));
0117 
0118 #ifdef __cplusplus
0119 }
0120 #endif
0121 
0122 #endif