use algorithms::crc::{self, Crc};
use algorithms::hash;
use iai::black_box;

fn crc_benchmark_native() -> <crc::Crc32 as Crc>::Checksum {
    crc::Crc32::checksum(black_box(&crc::CHECK_DATA))
}
fn crc_benchmark_ffi() -> <crc::ffi::Crc32 as Crc>::Checksum {
    crc::ffi::Crc32::checksum(black_box(&crc::CHECK_DATA))
}

fn hash_benchmark_native() -> hash::Digest256 {
    hash::sha2_256_oneshot(hash::HASH_EXAMPLE_DATA).unwrap()
}
fn hash_benchmark_ffi() -> hash::Digest256 {
    hash::ffi::sha2_256_oneshot(hash::HASH_EXAMPLE_DATA).unwrap()
}

iai::main!(
    crc_benchmark_native,
    crc_benchmark_ffi,
    hash_benchmark_native,
    hash_benchmark_ffi
);
