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_scryptsalsa208sha256_H 5 */ 6 7 module deimos.sodium.crypto_pwhash_scryptsalsa208sha256; 8 9 version(SODIUM_LIBRARY_MINIMAL) {} 10 else { 11 12 import deimos.sodium.export_; 13 14 15 extern(C) pure @nogc : 16 17 enum crypto_pwhash_scryptsalsa208sha256_BYTES_MIN = 16U; 18 19 size_t crypto_pwhash_scryptsalsa208sha256_bytes_min() @trusted; 20 21 enum crypto_pwhash_scryptsalsa208sha256_BYTES_MAX = 22 SODIUM_MIN(SODIUM_SIZE_MAX, 0x1fffffffe0UL); 23 24 size_t crypto_pwhash_scryptsalsa208sha256_bytes_max() @trusted; 25 26 enum crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN = 0U; 27 28 size_t crypto_pwhash_scryptsalsa208sha256_passwd_min() @trusted; 29 30 enum crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX = SODIUM_SIZE_MAX; 31 32 size_t crypto_pwhash_scryptsalsa208sha256_passwd_max() @trusted; 33 34 enum crypto_pwhash_scryptsalsa208sha256_SALTBYTES = 32U; 35 36 size_t crypto_pwhash_scryptsalsa208sha256_saltbytes() @trusted; 37 38 enum crypto_pwhash_scryptsalsa208sha256_STRBYTES = 102U; 39 40 size_t crypto_pwhash_scryptsalsa208sha256_strbytes() @trusted; 41 42 enum crypto_pwhash_scryptsalsa208sha256_STRPREFIX = "$7$"; 43 44 const(char)* crypto_pwhash_scryptsalsa208sha256_strprefix() @trusted; 45 46 enum crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN = 32768U; 47 48 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_min() @trusted; 49 50 enum crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX = 4294967295U; 51 52 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_max() @trusted; 53 54 enum crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN = 16777216U; 55 56 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_min() @trusted; 57 58 enum crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX = 59 SODIUM_MIN(size_t.max, 68719476736UL); 60 61 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_max() @trusted; 62 63 enum crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE = 524288U; 64 65 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_interactive() @trusted; 66 67 enum crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE = 16777216U; 68 69 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_interactive() @trusted; 70 71 enum crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE = 33554432U; 72 73 size_t crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive() @trusted; 74 75 enum crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = 1073741824U; 76 77 size_t crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive() @trusted; 78 79 int crypto_pwhash_scryptsalsa208sha256(ubyte* out_, 80 ulong outlen, 81 const(char*) passwd, 82 ulong passwdlen, 83 const(ubyte*) salt, 84 ulong opslimit, 85 size_t memlimit) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); 86 87 int crypto_pwhash_scryptsalsa208sha256_str(ref char[crypto_pwhash_scryptsalsa208sha256_STRBYTES] out_, 88 const(char*) passwd, 89 ulong passwdlen, 90 ulong opslimit, 91 size_t memlimit) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); 92 93 int crypto_pwhash_scryptsalsa208sha256_str_verify(ref const(char[crypto_pwhash_scryptsalsa208sha256_STRBYTES]) str, 94 const(char*) passwd, 95 ulong passwdlen) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); 96 97 int crypto_pwhash_scryptsalsa208sha256_ll(const(ubyte)* passwd, size_t passwdlen, 98 const(ubyte)* salt, size_t saltlen, 99 ulong N, uint r, uint p, 100 ubyte* buf, size_t buflen) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); 101 102 int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(ref const(char[crypto_pwhash_scryptsalsa208sha256_STRBYTES]) str, 103 ulong opslimit, 104 size_t memlimit) nothrow; // __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); 105 106 }