Trait mc_oblivious_traits::PositionMap [−][src]
pub trait PositionMap { fn len(&self) -> u64; fn write(&mut self, key: &u64, new_val: &u64) -> u64; }
PositionMap trait conceptually is an array of TreeIndex. Each value in the map corresponds to a leaf in the complete binary tree, at some common height.
PositionMap trait must be object-safe so that dyn PositionMap works. It also only needs to work with integer types, and padding up to u64 is fine. Therefore we make a new trait which is reduced and only exposes the things that PathORAM needs from the position map.
TODO: API for resizing it? Changing height?
Required methods
fn len(&self) -> u64
[src]
The number of keys in the map. The valid keys are in the range 0..len.
fn write(&mut self, key: &u64, new_val: &u64) -> u64
[src]
Write a new value to a particular key. The new value should be a random nonce from a CSPRNG. Returns the old value. It is illegal to write to a key that is out of bounds.