Crate argon2_ffi

Source
Expand description

Foreign Function Interface (FFI) bindings for the rust-argon2 crate.

§Return Values

Most functions return an int32_t. On successful completion, the value 0 is returned; otherwise a negative value is returned. The table below shows the meaning of the return values.

ValueDescription
0OK
-1Output pointer is NULL
-2Output is too short
-3Output is too long
-4Password is too short
-5Password is too long
-6Salt is too short
-7Salt is too long
-8Associated data is too short
-9Associated data is too long
-10Secret is too short
-11Secret is too long
-12Time cost is too small
-13Time cost is too large
-14Memory cost is too small
-15Memory cost is too large
-16Too few lanes
-17Too many lanes
-18Password pointer is NULL, but password length is not 0
-19Salt pointer is NULL, but salt length is not 0
-20Secret pointer is NULL, but secret length is not 0
-21Associated data pointer is NULL, bit ad length is not 0
-26There is no such version of Argon2
-31Encoding failed
-32Decoding failed
-35The password does not match the supplied hash
-36Hash pointer is NULL, but hash length is not 0

Statics§

ARGON2D
Argon2d variant.
ARGON2I
Argon2i variant.
ARGON2ID
Argon2id variant.
VERSION10
Argon version 10.
VERSION13
Argon version 13.

Functions§

encoded_len
Returns the length of a null terminated encoded string.
encoded_len_simple
Returns the length of a null terminated encoded string using default settings.
hash_encoded
Hashes the password and writes the encoded string to encoded.
hash_encoded_argon2d
Hashes the password using Argon2d and writes the encoded string to encoded.
hash_encoded_argon2i
Hashes the password using Argon2i and writes the encoded string to encoded.
hash_encoded_argon2id
Hashes the password using Argon2id and writes the encoded string to encoded.
hash_encoded_simple
Hashes the password using default settings and writes the encoded string to encoded.
hash_raw
Hashes the password and writes the hash bytes to out.
hash_raw_argon2d
Hashes the password using Argon2d and writes the hash bytes to out.
hash_raw_argon2i
Hashes the password using Argon2i and writes the hash bytes to out.
hash_raw_argon2id
Hashes the password using Argon2id and writes the hash bytes to out.
hash_raw_simple
Hashes the password using default settings and writes the hash bytes to out.
verify_encoded
Verifies the password with the encoded string and returns 0 when correct.
verify_raw
Verifies the password and returns 0 when correct.
verify_raw_argon2d
Verifies the password using Argon2d and returns 0 when correct.
verify_raw_argon2i
Verifies the password using Argon2i and returns 0 when correct.
verify_raw_argon2id
Verifies the password using Argon2id and returns 0 when correct.
verify_raw_simple
Verifies the password using default settings and returns 0 when correct.