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§

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.