oof 0.1.1

Naive proof scheme for accelerated testing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::V;
use arrayref::array_ref;
use sha2::{Digest, Sha256};

pub fn hash(left: &V, right: &V) -> V {
    let mut buf = [0u8; 64];
    buf[0..32].copy_from_slice(left);
    buf[32..64].copy_from_slice(right);
    let tmp = Sha256::digest(&buf);
    buf[0..32].copy_from_slice(tmp.as_ref());
    *array_ref![buf, 0, 32]
}