libcrypt_rs/
raw.rs

1//! Raw bindings to libcrypt. unsafe rust required
2
3use std::os::raw::*;
4
5/// Isn't created for libcrypt interaction. usized.
6pub const CRYPT_OUTPUT_SIZE: usize = 384;
7/// Isn't created for libcrypt interaction. usized.
8pub const CRYPT_MAX_PASSPHRASE: usize = 512;
9
10pub const CRYPT_SALT_OK: c_int = 0;
11pub const CRYPT_SALT_INVALID: c_int = 1;
12pub const CRYPT_SALT_METHOD_DISABLED: c_int = 2;
13pub const CRYPT_SALT_METHOD_LEGACY: c_int = 3;
14pub const CRYPT_SALT_TOO_CHEAP: c_int = 4;
15
16extern "C" {
17	pub fn crypt(phrase: *const c_char, setting: *const c_char) -> *const c_char;
18
19	pub fn crypt_gensalt(phrase: *const c_char, count: c_ulong, rbytes: *const c_char, nrbytes: c_int) -> *const c_char;
20
21	pub fn crypt_preferred_method() -> *const c_char;
22
23	pub fn crypt_checksalt(setting: *const c_char) -> c_int;
24}