File: lib.rs

package info (click to toggle)
rust-scrypt 0.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 136 kB
  • sloc: makefile: 2
file content (18 lines) | stat: -rw-r--r-- 395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![no_std]
#![feature(test)]

extern crate test;

use test::Bencher;

#[bench]
pub fn scrypt_15_8_1(bh: &mut Bencher) {
    let password = b"my secure password";
    let salt = b"salty salt";
    let mut buf = [0u8; 32];
    let params = scrypt::Params::recommended();
    bh.iter(|| {
        scrypt::scrypt(password, salt, &params, &mut buf).unwrap();
        test::black_box(&buf);
    });
}