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
- Argon2d variant.
- ARGON2I
- Argon2i variant.
- ARGO
N2ID - Argon2id variant.
- VERSIO
N10 - Argon version 10.
- VERSIO
N13 - 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
0when correct. - verify_
raw - Verifies the password and returns
0when correct. - verify_
raw_ argon2d - Verifies the password using Argon2d and returns
0when correct. - verify_
raw_ argon2i - Verifies the password using Argon2i and returns
0when correct. - verify_
raw_ argon2id - Verifies the password using Argon2id and returns
0when correct. - verify_
raw_ simple - Verifies the password using default settings and returns
0when correct.