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_argon2id_H
5 */
6 
7 module deimos.sodium.crypto_pwhash_argon2id;
8 
9 import deimos.sodium.export_;
10 
11 extern(C) nothrow pure :
12 
13 
14 enum crypto_pwhash_argon2id_ALG_ARGON2ID13 = 2;
15 
16 int crypto_pwhash_argon2id_alg_argon2id13() @trusted;
17 
18 enum crypto_pwhash_argon2id_BYTES_MIN = 16U;
19 
20 size_t crypto_pwhash_argon2id_bytes_min() @trusted;
21 
22 enum crypto_pwhash_argon2id_BYTES_MAX = SODIUM_MIN(SODIUM_SIZE_MAX, 4294967295U);
23 
24 size_t crypto_pwhash_argon2id_bytes_max() @trusted;
25 
26 enum crypto_pwhash_argon2id_PASSWD_MIN = 0U;
27 
28 size_t crypto_pwhash_argon2id_passwd_min() @trusted;
29 
30 enum crypto_pwhash_argon2id_PASSWD_MAX = 4294967295U;
31 
32 size_t crypto_pwhash_argon2id_passwd_max() @trusted;
33 
34 enum crypto_pwhash_argon2id_SALTBYTES = 16U;
35 
36 size_t crypto_pwhash_argon2id_saltbytes() @trusted;
37 
38 enum crypto_pwhash_argon2id_STRBYTES = 128U;
39 
40 size_t crypto_pwhash_argon2id_strbytes() @trusted;
41 
42 enum crypto_pwhash_argon2id_STRPREFIX = "$argon2id$";
43 
44 const(char)* crypto_pwhash_argon2id_strprefix();
45 
46 enum crypto_pwhash_argon2id_OPSLIMIT_MIN = 1U;
47 
48 size_t crypto_pwhash_argon2id_opslimit_min() @trusted;
49 
50 enum crypto_pwhash_argon2id_OPSLIMIT_MAX = 4294967295U;
51 
52 size_t crypto_pwhash_argon2id_opslimit_max() @trusted;
53 
54 enum crypto_pwhash_argon2id_MEMLIMIT_MIN = 8192U;
55 
56 size_t crypto_pwhash_argon2id_memlimit_min() @trusted;
57 
58 enum crypto_pwhash_argon2id_MEMLIMIT_MAX =
59     ((size_t.max >= 4398046510080U) ? 4398046510080U : (size_t.max >= 2147483648U) ? 2147483648U : 32768U);
60 
61 size_t crypto_pwhash_argon2id_memlimit_max() @trusted;
62 
63 enum crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE = 2U;
64 
65 size_t crypto_pwhash_argon2id_opslimit_interactive() @trusted;
66 
67 enum crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE = 67108864U;
68 
69 size_t crypto_pwhash_argon2id_memlimit_interactive() @trusted;
70 
71 enum crypto_pwhash_argon2id_OPSLIMIT_MODERATE = 3U;
72 
73 size_t crypto_pwhash_argon2id_opslimit_moderate() @trusted;
74 
75 enum crypto_pwhash_argon2id_MEMLIMIT_MODERATE = 268435456U;
76 
77 size_t crypto_pwhash_argon2id_memlimit_moderate() @trusted;
78 
79 enum crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE = 4U;
80 
81 size_t crypto_pwhash_argon2id_opslimit_sensitive() @trusted;
82 
83 enum crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE = 1073741824U;
84 
85 size_t crypto_pwhash_argon2id_memlimit_sensitive() @trusted;
86 
87 int crypto_pwhash_argon2id(ubyte* out_,
88                            ulong outlen,
89                            const(char*) passwd,
90                            ulong passwdlen,
91                            const(ubyte*) salt,
92                            ulong opslimit, size_t memlimit,
93                            int alg); // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
94 
95 int crypto_pwhash_argon2id_str(ref char[crypto_pwhash_argon2id_STRBYTES] out_,
96                                const(char*) passwd,
97                                ulong passwdlen,
98                                ulong opslimit, size_t memlimit); // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
99 
100 int crypto_pwhash_argon2id_str_verify(ref const(char[crypto_pwhash_argon2id_STRBYTES]) str,
101                                       const(char*) passwd,
102                                       ulong passwdlen); // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
103 
104 int crypto_pwhash_argon2id_str_needs_rehash(ref const(char[crypto_pwhash_argon2id_STRBYTES]) str,
105                                             ulong opslimit, size_t memlimit); // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));