Trait BaseORAM

Source
pub trait BaseORAM: Send {
    // Required methods
    fn read(&mut self, block_id: i64) -> Vec<u8> ;
    fn write(&mut self, block_id: i64, data: Bytes) -> usize;
    fn size(&self) -> i64;
    fn name(&self) -> String;
    fn args(&self) -> &ORAMConfig;

    // Provided methods
    fn test_state(&mut self) -> bool { ... }
    fn init(&mut self) { ... }
    fn cleanup(&mut self) { ... }
    fn post_op(&mut self) { ... }
    fn node_filename(&self, i: i64) -> String { ... }
    fn node_path(&self, i: i64) -> String { ... }
}
Expand description

Base trait for an ORAM scheme

Required Methods§

Source

fn read(&mut self, block_id: i64) -> Vec<u8>

Read block with id block_id and return the bytes read

Source

fn write(&mut self, block_id: i64, data: Bytes) -> usize

Write bytes in data inside of block with id block_id. Return the number of bytes written.

Source

fn size(&self) -> i64

Return the total size of the ORAM

Source

fn name(&self) -> String

Return the oram’s name

Source

fn args(&self) -> &ORAMConfig

Return the CLI arguments

Provided Methods§

Source

fn test_state(&mut self) -> bool

Source

fn init(&mut self)

Initialize the ORAM

Source

fn cleanup(&mut self)

Cleanup the ORAM

Source

fn post_op(&mut self)

Called after each read or write operation

Source

fn node_filename(&self, i: i64) -> String

Return the filename of the node with given number

Source

fn node_path(&self, i: i64) -> String

Return the path to the node with given number

Implementors§