Fabcoin Core  0.16.2
P2P Digital Currency
libscrypt.h
Go to the documentation of this file.
1 /*-
2  */
3 #ifndef _CRYPTO_SCRYPT_H_
4 #define _CRYPTO_SCRYPT_H_
5 
6 
7 #include <stdint.h>
8 
9 #ifdef __cplusplus
10 extern "C"{
11 #endif
12 
29 int libscrypt_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t,
30  uint32_t, uint32_t, /*@out@*/ uint8_t *, size_t);
31 
32 /* Converts a series of input parameters to a MCF form for storage */
33 int libscrypt_mcf(uint32_t N, uint32_t r, uint32_t p, const char *salt,
34  const char *hash, char *mcf);
35 
36 /* Checks a given MCF against a password */
37 int libscrypt_check(char *mcf, const char *password);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 /* Sane default values */
44 #define SCRYPT_HASH_LEN 64 /* This can be user defined -
45  *but 64 is the reference size
46  */
47 #define SCRYPT_SAFE_N 30 /* This is much higher than you want. It's just
48  * a blocker for insane defines
49  */
50 #define SCRYPT_SALT_LEN 16 /* This is just a recommended size */
51 #define SCRYPT_MCF_LEN 125 /* mcf is 120 byte + nul */
52 #define SCRYPT_MCF_ID "$s1"
53 #define SCRYPT_N 16384
54 #define SCRYPT_r 8
55 #define SCRYPT_p 16
56 #endif /* !_CRYPTO_SCRYPT_H_ */
int libscrypt_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, uint32_t, uint32_t, uint8_t *, size_t)
crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): Compute scrypt(passwd[0 ...
int libscrypt_check(char *mcf, const char *password)
int libscrypt_mcf(uint32_t N, uint32_t r, uint32_t p, const char *salt, const char *hash, char *mcf)
Definition: crypto-mcf.c:41