Start implementing grow merkle fn

This commit is contained in:
Paul Hauner 2019-04-13 09:11:19 +10:00
parent d79616fee6
commit a124042e30
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C

View File

@ -170,6 +170,23 @@ where
}
}
/// New vec is bigger than old vec.
fn grow_merkle_cache(cache: Vec<u8>, to: usize) -> Vec<u8> {
let new = Vec::with_capacity(to * HASHSIZE);
let i = cache.len() / HASHSIZE;
let j = to;
assert_eq!(i.next_power_of_two(), i);
assert_eq!(j.next_power_of_two(), j);
while i > 0 {
}
new
}
fn get_packed_leaves<T>(vec: &Vec<T>) -> Vec<u8>
where
T: CachedTreeHash<T>,