Struct mc_oblivious_traits::LinearScanningORAM
source · pub struct LinearScanningORAM<ValueSize: ArrayLength<u8>> { /* private fields */ }
Implementations§
source§impl<ValueSize: ArrayLength<u8>> LinearScanningORAM<ValueSize>
impl<ValueSize: ArrayLength<u8>> LinearScanningORAM<ValueSize>
Trait Implementations§
source§impl<ValueSize: ArrayLength<u8>> ORAM<ValueSize> for LinearScanningORAM<ValueSize>
impl<ValueSize: ArrayLength<u8>> ORAM<ValueSize> for LinearScanningORAM<ValueSize>
source§fn len(&self) -> u64
fn len(&self) -> u64
Get the number of values logically in the ORAM.
This is also one more than the largest index that can be legally
accessed.
source§fn stash_size(&self) -> usize
fn stash_size(&self) -> usize
Get the number of values in the ORAM’s stash for diagnostics. In prod,
this number should be viewed as secret and not revealed.
source§fn access<T, F: FnOnce(&mut A64Bytes<ValueSize>) -> T>(
&mut self,
query: u64,
f: F
) -> T
fn access<T, F: FnOnce(&mut A64Bytes<ValueSize>) -> T>( &mut self, query: u64, f: F ) -> T
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. Read more
source§fn read(&mut self, index: u64) -> A64Bytes<ValueSize>
fn read(&mut self, index: u64) -> A64Bytes<ValueSize>
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.source§fn write(
&mut self,
index: u64,
new_val: &A64Bytes<ValueSize>
) -> A64Bytes<ValueSize>
fn write( &mut self, index: u64, new_val: &A64Bytes<ValueSize> ) -> A64Bytes<ValueSize>
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.