1 /*
2 Written in the D programming language.
3 For git maintenance (ensure at least one congruent line with originating C header):
4 #define crypto_pwhash_argon2i_H
5 */
6 
7 module deimos.sodium.crypto_pwhash_argon2i;
8 
9 import deimos.sodium.export_;
10 
11 
12 extern(C) pure @nogc :
13 
14 
15 enum crypto_pwhash_argon2i_ALG_ARGON2I13 = 1;
16 
17 int crypto_pwhash_argon2i_alg_argon2i13() @trusted;
18 
19 enum crypto_pwhash_argon2i_BYTES_MIN = 16U;
20 
21 size_t crypto_pwhash_argon2i_bytes_min() @trusted;
22 
23 enum crypto_pwhash_argon2i_BYTES_MAX = SODIUM_MIN(SODIUM_SIZE_MAX, 4294967295U);
24 
25 size_t crypto_pwhash_argon2i_bytes_max() @trusted;
26 
27 enum crypto_pwhash_argon2i_PASSWD_MIN = 0U;
28 
29 size_t crypto_pwhash_argon2i_passwd_min() @trusted;
30 
31 enum crypto_pwhash_argon2i_PASSWD_MAX = 4294967295U;
32 
33 size_t crypto_pwhash_argon2i_passwd_max() @trusted;
34 
35 enum crypto_pwhash_argon2i_SALTBYTES = 16U;
36 
37 size_t crypto_pwhash_argon2i_saltbytes() @trusted;
38 
39 enum crypto_pwhash_argon2i_STRBYTES = 128U;
40 
41 size_t crypto_pwhash_argon2i_strbytes() @trusted;
42 
43 enum crypto_pwhash_argon2i_STRPREFIX = "$argon2i$";
44 
45 const(char)* crypto_pwhash_argon2i_strprefix() @trusted;
46 
47 enum crypto_pwhash_argon2i_OPSLIMIT_MIN = 3U;
48 
49 size_t crypto_pwhash_argon2i_opslimit_min() @trusted;
50 
51 enum crypto_pwhash_argon2i_OPSLIMIT_MAX = 4294967295U;
52 
53 size_t crypto_pwhash_argon2i_opslimit_max() @trusted;
54 
55 enum crypto_pwhash_argon2i_MEMLIMIT_MIN = 8192U;
56 
57 size_t crypto_pwhash_argon2i_memlimit_min() @trusted;
58 
59 enum crypto_pwhash_argon2i_MEMLIMIT_MAX =
60     ((size_t.max >= 4398046510080U) ? 4398046510080U : (size_t.max >= 2147483648U) ? 2147483648U : 32768U);
61 
62 size_t crypto_pwhash_argon2i_memlimit_max() @trusted;
63 
64 enum crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE = 4U;
65 
66 size_t crypto_pwhash_argon2i_opslimit_interactive() @trusted;
67 
68 enum crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE = 33554432U;
69 
70 size_t crypto_pwhash_argon2i_memlimit_interactive() @trusted;
71 
72 enum crypto_pwhash_argon2i_OPSLIMIT_MODERATE = 6U;
73 
74 size_t crypto_pwhash_argon2i_opslimit_moderate() @trusted;
75 
76 enum crypto_pwhash_argon2i_MEMLIMIT_MODERATE = 134217728U;
77 
78 size_t crypto_pwhash_argon2i_memlimit_moderate() @trusted;
79 
80 enum crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE = 8U;
81 
82 size_t crypto_pwhash_argon2i_opslimit_sensitive() @trusted;
83 
84 enum crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE = 536870912U;
85 
86 size_t crypto_pwhash_argon2i_memlimit_sensitive() @trusted;
87 
88 int crypto_pwhash_argon2i(ubyte* out_,
89                           ulong outlen,
90                           const(char*) passwd,
91                           ulong passwdlen,
92                           const(ubyte*) salt,
93                           ulong opslimit, size_t memlimit,
94                           int alg) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
95 
96 int crypto_pwhash_argon2i_str(ref char[crypto_pwhash_argon2i_STRBYTES] out_,
97                               const(char*) passwd,
98                               ulong passwdlen,
99                               ulong opslimit, size_t memlimit) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
100 
101 int crypto_pwhash_argon2i_str_verify(ref const(char[crypto_pwhash_argon2i_STRBYTES]) str,
102                                      const(char*) passwd,
103                                      ulong passwdlen) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
104 
105 int crypto_pwhash_argon2i_str_needs_rehash(ref const(char[crypto_pwhash_argon2i_STRBYTES]) str,
106                                            ulong opslimit, size_t memlimit) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));