[][src]Function devolutions_crypto::ffi::VerifyPassword

#[no_mangle]
pub unsafe extern "C" fn VerifyPassword(
    password: *const u8,
    password_length: usize,
    hash: *const u8,
    hash_length: usize
) -> i64

Verify a password against a hash with constant-time equality.

Arguments

  • password - Pointer to the password to verify.
  • password_length - Length of the password to verify.
  • hash - Pointer to the hash to verify.
  • hash_length - Length of the hash to verify.

Returns

Returns 0 if the password is invalid or 1 if the password is valid. If there is an error, it will return the appropriate error code defined in DevoCryptoError.