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.
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 variant.
- Argon2i variant.
- Argon2id variant.
- Argon version 10.
- Argon version 13.
Functions§
- Returns the length of a null terminated encoded string.
- Returns the length of a null terminated encoded string using default settings.
- Hashes the password and writes the encoded string to
encoded
. - Hashes the password using Argon2d and writes the encoded string to
encoded
. - Hashes the password using Argon2i and writes the encoded string to
encoded
. - Hashes the password using Argon2id and writes the encoded string to
encoded
. - Hashes the password using default settings and writes the encoded string to
encoded
. - Hashes the password and writes the hash bytes to
out
. - Hashes the password using Argon2d and writes the hash bytes to
out
. - Hashes the password using Argon2i and writes the hash bytes to
out
. - Hashes the password using Argon2id and writes the hash bytes to
out
. - Hashes the password using default settings and writes the hash bytes to
out
. - Verifies the password with the encoded string and returns
0
when correct. - Verifies the password and returns
0
when correct. - Verifies the password using Argon2d and returns
0
when correct. - Verifies the password using Argon2i and returns
0
when correct. - Verifies the password using Argon2id and returns
0
when correct. - Verifies the password using default settings and returns
0
when correct.