insectbox 0.1.0

OpenSSH inspired in-memory key security.
Documentation
use criterion::{criterion_group, criterion_main, Criterion};

use insectbox::CryptBox;

fn cryptbox_new() {
    let b = CryptBox::new(heapless::Vec::<u8, 0xfe8>::new());
    let mut b = b.decrypt();
    b.fill_with(|| 0x5d);
    let _b = CryptBox::encrypt(b);
}

fn cryptbox_construct() {
    let b = CryptBox::construct(heapless::Vec::<u8, 0xfe8>::new);
    let mut b = b.decrypt();
    b.fill_with(|| 0x5d);
    let _b = CryptBox::encrypt(b);
}

fn criterion_benchmark(c: &mut Criterion) {
    c.bench_function("CryptBox::new", |b| b.iter(|| cryptbox_new()));
    c.bench_function("CryptBox::construct", |b| b.iter(|| cryptbox_construct()));
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);