Struct ORAMManager

Source
pub struct ORAMManager;

Implementations§

Source§

impl ORAMManager

Source

pub fn config_path() -> String

Source

pub fn list_orams(oneline: bool)

List ORAMs

Source

pub fn add_oram(oram_name: String, cmd: CLISubCommand)

Add an ORAM

Source

pub fn remove_oram(oram_name: String)

Remove an ORAM

Source

pub fn get_config() -> ORAMFSConfig

Get global configuration

Source

pub fn get_oram_config(name: String) -> ORAMConfig

Get a specific ORAM’s configuration

Source

pub fn save_config(config: &ORAMFSConfig)

Save configuration to disk

Source

pub fn mark_init(name: String)

Mark ORAM with name name as init=true and save configuration to disk

Source

pub fn generate_encryption_key( name: String, passphrase: String, salt: String, cipher: String, ) -> String

Generate an encryption key and save it (encrypted) in the ORAM’s configuration

Source

pub fn serialize_key(encrypted_key: Vec<u8>, nonce: Vec<u8>) -> String

Serialize encrypted key and nonce

Source

pub fn deserialize_key(serialized_key: String) -> (Vec<u8>, Vec<u8>)

Deserialize encrypted key and nonce

Source

pub fn encrypt_key( key: Vec<u8>, cleartext: Vec<u8>, ) -> Result<(Vec<u8>, Vec<u8>), Error>

Encrypt encryption key using AES256-GCM and return ciphertext and nonce

Source

pub fn decrypt_key( key: Vec<u8>, ciphertext: Vec<u8>, nonce: Vec<u8>, ) -> Result<Vec<u8>, Error>

Decrypt encryption key

Source

pub fn derive_key(passphrase: &str, salt: &str) -> (Vec<u8>, String)

Derive a key from the given passphrase and salt

Source

pub fn is_passphrase_valid( passphrase: String, salt: String, encrypted_encryption_key: String, ) -> bool

Return true if the given passphrase is valid This effectively tries to decrypt the AEAD encrypted key. If the passphrase is not the right one, this will fail.

Source

pub fn interactive_config(args: &mut ORAMConfig)

Interactively ask ORAM parameters from the user

Source

pub fn ask_oram_size(args: &mut ORAMConfig)

Ask the ORAM size from the user and set it on the ORAMConfig instance

Source

pub fn ask_client_data_dir(args: &mut ORAMConfig)

Interactively ask the client data directory from the user

Source

pub fn ask_mountpoint(args: &mut ORAMConfig)

Source

pub fn tmp_filename(old: i64, i: i64) -> String

Return temporary filename This is useful for the enlarge operation

Source

pub fn unique_tmp_node_path(old: i64, i: i64, args: &ORAMConfig) -> String

Return temporary filepath This is useful for the enlarge operation

Source

pub fn double(cmd: CLISubCommand)

Enlarges an existing oram by doubling its number of nodes. This should be called when the oram is unmounted.

Source

pub fn do_double(args: &mut ORAMConfig, manual: bool)

Actually enlarge the ORAM

Source

pub fn resize2fs_enlarge(args: ORAMConfig)

Run resize2fs on the ORAM file

Source

pub fn get_passphrase() -> String

Interactively ask the passphrase from the user

Source

pub fn get_passphrase_first_time() -> String

Interactively ask for a new passphrase from the user This will ask twice to confirm and make sure that both passphrases match

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V