#![feature(test)]

extern crate test;
extern crate ethereum_types;
extern crate keccak_hash;

use keccak_hash::{keccak, write_keccak};
use test::Bencher;

#[bench]
fn bench_keccak_256_with_empty_input(b: &mut Bencher) {
    let empty = [0u8;0];
    b.bytes = empty.len() as u64;
    b.iter(|| {
        let _out = keccak(empty);
    })
}

#[bench]
fn bench_keccak_256_with_typical_input(b: &mut Bencher) {
    let data: Vec<u8> = From::from("some medum length string with important information");
    b.bytes = data.len() as u64;
    b.iter(|| {
        let _out = keccak(&data);
    })
}

#[bench]
fn bench_keccak_256_with_large_input(b: &mut Bencher) {
    // 4096 chars
    let data: Vec<u8> = From::from("[encoded data, 4096 characters]");
    b.bytes = data.len() as u64;
    b.iter(|| {
        let _out = keccak(&data);
    })
}