Trait mc_oblivious_traits::ORAM[][src]

pub trait ORAM<ValueSize: ArrayLength<u8>> {
    fn len(&self) -> u64;
fn access<T, F: FnOnce(&mut A64Bytes<ValueSize>) -> T>(
        &mut self,
        index: u64,
        func: F
    ) -> T; fn read(&mut self, index: u64) -> A64Bytes<ValueSize> { ... }
fn write(
        &mut self,
        index: u64,
        new_val: &A64Bytes<ValueSize>
    ) -> A64Bytes<ValueSize> { ... } }

An Oblivious RAM – that is, an array like [A8Bytes; N] which supports access queries without memory access patterns revealing what indices were queried. (Here, N is a runtime parameter set at construction time.)

The ValueSize parameter indicates the number of bytes in a stored value.

The key-type here is always u64 even if it “could” be smaller. We think that if keys are actually stored as u32 or u16 in some of the recursive position maps, that conversion can happen at a different layer of the system.

TODO: Should there be, perhaps, a separate trait for “resizable” ORAMs? We don’t have a good way for the OMAP to take advantage of that right now.

Required methods

fn len(&self) -> u64[src]

Get the number of values logically in the ORAM. This is also one more than the largest index that can be legally accessed.

fn access<T, F: FnOnce(&mut A64Bytes<ValueSize>) -> T>(
    &mut self,
    index: u64,
    func: F
) -> T
[src]

Access the ORAM at a position, calling a lambda with the recovered value, and returning the result of the lambda. This cannot fail, but will panic if index is out of bounds.

This is the lowest-level API that we offer for getting data from the ORAM.

Loading content...

Provided methods

fn read(&mut self, index: u64) -> A64Bytes<ValueSize>[src]

High-level helper – when you only need to read and don’t need to write a new value, this is simpler than using access. In most ORAM there will not be a significantly faster implementation of this.

fn write(
    &mut self,
    index: u64,
    new_val: &A64Bytes<ValueSize>
) -> A64Bytes<ValueSize>
[src]

High-level helper – when you need to write a value and want the previous value, but you don’t need to see the previous value when deciding what to write, this is simpler than using access. In most ORAM there will not be a significantly faster implementation of this.

Loading content...

Implementors

impl<ValueSize: ArrayLength<u8>> ORAM<ValueSize> for LinearScanningORAM<ValueSize>[src]

Loading content...