fastpbkdf2 0.1.0

A rust binding for fastpbkdf2. This is a PBKDF2 with HMAC-SHA1, HMAC-SHA256 and HMAC-SHA512 and is faster than other implementations.
Documentation
extern crate libc;
use libc::size_t;

#[link(name = "fastpbkdf2")]
#[link(name = "crypto")]
extern {
  fn fastpbkdf2_hmac_sha1(pw: *const u8, npw: size_t,
                          salt: *const u8, nsalt: size_t,
                          iterations: u32,
                          out: *mut u8, nout: size_t);
  fn fastpbkdf2_hmac_sha256(pw: *const u8, npw: size_t,
                            salt: *const u8, nsalt: size_t,
                            iterations: u32,
                            out: *mut u8, nout: size_t);
  fn fastpbkdf2_hmac_sha512(pw: *const u8, npw: size_t,
                            salt: *const u8, nsalt: size_t,
                            iterations: u32,
                            out: *mut u8, nout: size_t);
}

pub fn pbkdf2_hmac_sha1(password: &[u8], salt: &[u8], iterations: u32, out: &mut[u8]) {
  assert!(iterations != 0);
  unsafe {
    fastpbkdf2_hmac_sha1(password.as_ptr(), password.len() as size_t,
                         salt.as_ptr(), salt.len() as size_t,
                         iterations,
                         out.as_mut_ptr(), out.len() as size_t);
  }
}

pub fn pbkdf2_hmac_sha256(password: &[u8], salt: &[u8], iterations: u32, out: &mut[u8]) {
  assert!(iterations != 0);
  unsafe {
    fastpbkdf2_hmac_sha256(password.as_ptr(), password.len() as size_t,
                           salt.as_ptr(), salt.len() as size_t,
                           iterations,
                           out.as_mut_ptr(), out.len() as size_t);
  }
}

pub fn pbkdf2_hmac_sha512(password: &[u8], salt: &[u8], iterations: u32, out: &mut[u8]) {
  assert!(iterations != 0);
  unsafe {
    fastpbkdf2_hmac_sha512(password.as_ptr(), password.len() as size_t,
                           salt.as_ptr(), salt.len() as size_t,
                           iterations,
                           out.as_mut_ptr(), out.len() as size_t);
  }
}