pub trait IdpfCache {
// Required methods
fn get(&self, input: &BitSlice) -> Option<([u8; 16], u8)>;
fn insert(&mut self, input: &BitSlice, values: &([u8; 16], u8));
}
Available on crate features
crypto-dependencies
and experimental
only.Expand description
An interface that provides memoization of IDPF computations.
Each instance of a type implementing IdpfCache
should only be used with one IDPF key and
public share.
In typical use, IDPFs will be evaluated repeatedly on inputs of increasing length, as part of a protocol executed by multiple participants. Each IDPF evaluation computes keys and control bits corresponding to tree nodes along a path determined by the input to the IDPF. Thus, the values from nodes further up in the tree may be cached and reused in evaluations of subsequent longer inputs. If one IDPF input is a prefix of another input, then the first input’s path down the tree is a prefix of the other input’s path.