Crate argon2_ffi [] [src]

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.

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