1 unstable release
Uses old Rust 2015
0.1.0 | Mar 22, 2017 |
---|
#20 in #foreign
46KB
1K
SLoC
Rust-argon2-ffi
Foreign Function Interface (FFI) bindings for the rust-argon2 crate.
Examples
The examples directory contains a Haskell example project that shows how to use this crate with Haskell.
License
Rust-argon2-ffi is dual licensed under the MIT and Apache 2.0 licenses, the same licenses as the Rust compiler.
Contributions
Contributions are welcome. By submitting a pull request you are agreeing to make you work available under the license terms of the Rust-argon2-ffi project.
lib.rs
:
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 |
Dependencies
~500KB