Rust implementation of the key derivation tree used in TimeCrypt(Link).
cargo build
Initialize the Key Derivation Tree with the master secret key and 32 bit inputs.
let key = [0u8; 16];
let prf = ConstrainedPrf::init(32, key);Derive the i-th key.
let key_out = prf.apply(i).unwrap();Give access to the keys in the range [1,15).
let node_keys = prf.constrain(1, 15).unwrap();Initialize the Key Derivation Tree with the constrained nodes.
let prf2 = ConstrainedPrf::new(32, node_keys);
// derive key ok
let key_out = prf.apply(2).unwrap();
// derive key error
let key_out = prf.apply(0).unwrap();cargo bench
This is a research prototype.