Trait prio::idpf::IdpfCache

source ·
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.

Required Methods§

source

fn get(&self, input: &BitSlice) -> Option<([u8; 16], u8)>

Fetch cached values for the node identified by the IDPF input.

source

fn insert(&mut self, input: &BitSlice, values: &([u8; 16], u8))

Store values corresponding to the node identified by the IDPF input.

Implementors§