Functions

fn kdf(allocator: mem.Allocator, derived_key: []u8, password: []const u8, salt: []const u8, params: Params) KdfError!void

Apply scrypt to generate a key from a password.

Apply scrypt to generate a key from a password.

scrypt is defined in RFC 7914.

allocator: mem.Allocator.

derived_key: Slice of appropriate size for generated key. Generally 16 or 32 bytes in length. May be uninitialized. All bytes will be overwritten. Maximum size is derived_key.len / 32 == 0xffff_ffff.

password: Arbitrary sequence of bytes of any length.

salt: Arbitrary sequence of bytes of any length.

params: Params.

fn strHash(password: []const u8, options: HashOptions, out: []u8) Error![]const u8

Compute a hash of a password using the scrypt key derivation function. The func…

Compute a hash of a password using the scrypt key derivation function. The function returns a string that includes all the parameters required for verification.

fn strVerify(str: []const u8, password: []const u8, options: VerifyOptions) Error!void

Verify that a previously computed hash is valid for a given password.