openHiTLS API openHiTLS 0.1.0-Alpha1

◆ CRYPT_EAL_Scrypt()

int32_t CRYPT_EAL_Scrypt ( const uint8_t *  key,
uint32_t  keyLen,
const uint8_t *  salt,
uint32_t  saltLen,
uint32_t  n,
uint32_t  r,
uint32_t  p,
uint8_t *  out,
uint32_t  len 
)

scrypt Password-based key derivation function

参数
key[IN] Password, a string input by the user.
keyLen[IN] Password length, including 0
salt[IN] Salt value, a string input by the user.
saltLen[IN] Salt value length, including 0
n[IN] CPU and memory consumption parameters. The value must be a power of 2, greater than 1 and less than 2 ^ (128 * r / 8)
r[IN] Block size parameter, any positive integer not 0 where r * p < 2 ^ 30
p[IN] Parallelization parameter, any positive integer not 0; p <= (2 ^ 32 - 1) * 32 / (128 * r)
out[OUT] Derived key, which cannot be null.
len[IN] Length of the derived key. Range: (0, 0xFFFFFFFF]
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h