pub struct ORAMManager;
Implementations§
Source§impl ORAMManager
impl ORAMManager
pub fn config_path() -> String
Sourcepub fn list_orams(oneline: bool)
pub fn list_orams(oneline: bool)
List ORAMs
Sourcepub fn add_oram(oram_name: String, cmd: CLISubCommand)
pub fn add_oram(oram_name: String, cmd: CLISubCommand)
Add an ORAM
Sourcepub fn remove_oram(oram_name: String)
pub fn remove_oram(oram_name: String)
Remove an ORAM
Sourcepub fn get_config() -> ORAMFSConfig
pub fn get_config() -> ORAMFSConfig
Get global configuration
Sourcepub fn get_oram_config(name: String) -> ORAMConfig
pub fn get_oram_config(name: String) -> ORAMConfig
Get a specific ORAM’s configuration
Sourcepub fn save_config(config: &ORAMFSConfig)
pub fn save_config(config: &ORAMFSConfig)
Save configuration to disk
Sourcepub fn mark_init(name: String)
pub fn mark_init(name: String)
Mark ORAM with name name
as init=true and save configuration to disk
Sourcepub fn generate_encryption_key(
name: String,
passphrase: String,
salt: String,
cipher: String,
) -> String
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
Sourcepub fn serialize_key(encrypted_key: Vec<u8>, nonce: Vec<u8>) -> String
pub fn serialize_key(encrypted_key: Vec<u8>, nonce: Vec<u8>) -> String
Serialize encrypted key and nonce
Sourcepub fn deserialize_key(serialized_key: String) -> (Vec<u8>, Vec<u8>)
pub fn deserialize_key(serialized_key: String) -> (Vec<u8>, Vec<u8>)
Deserialize encrypted key and nonce
Sourcepub fn encrypt_key(
key: Vec<u8>,
cleartext: Vec<u8>,
) -> Result<(Vec<u8>, Vec<u8>), Error>
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
Sourcepub fn decrypt_key(
key: Vec<u8>,
ciphertext: Vec<u8>,
nonce: Vec<u8>,
) -> Result<Vec<u8>, Error>
pub fn decrypt_key( key: Vec<u8>, ciphertext: Vec<u8>, nonce: Vec<u8>, ) -> Result<Vec<u8>, Error>
Decrypt encryption key
Sourcepub fn derive_key(passphrase: &str, salt: &str) -> (Vec<u8>, String)
pub fn derive_key(passphrase: &str, salt: &str) -> (Vec<u8>, String)
Derive a key from the given passphrase and salt
Sourcepub fn is_passphrase_valid(
passphrase: String,
salt: String,
encrypted_encryption_key: String,
) -> bool
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.
Sourcepub fn interactive_config(args: &mut ORAMConfig)
pub fn interactive_config(args: &mut ORAMConfig)
Interactively ask ORAM parameters from the user
Sourcepub fn ask_oram_size(args: &mut ORAMConfig)
pub fn ask_oram_size(args: &mut ORAMConfig)
Ask the ORAM size from the user and set it on the ORAMConfig instance
Sourcepub fn ask_client_data_dir(args: &mut ORAMConfig)
pub fn ask_client_data_dir(args: &mut ORAMConfig)
Interactively ask the client data directory from the user
pub fn ask_mountpoint(args: &mut ORAMConfig)
Sourcepub fn tmp_filename(old: i64, i: i64) -> String
pub fn tmp_filename(old: i64, i: i64) -> String
Return temporary filename This is useful for the enlarge operation
Sourcepub fn unique_tmp_node_path(old: i64, i: i64, args: &ORAMConfig) -> String
pub fn unique_tmp_node_path(old: i64, i: i64, args: &ORAMConfig) -> String
Return temporary filepath This is useful for the enlarge operation
Sourcepub fn double(cmd: CLISubCommand)
pub fn double(cmd: CLISubCommand)
Enlarges an existing oram by doubling its number of nodes. This should be called when the oram is unmounted.
Sourcepub fn do_double(args: &mut ORAMConfig, manual: bool)
pub fn do_double(args: &mut ORAMConfig, manual: bool)
Actually enlarge the ORAM
Sourcepub fn resize2fs_enlarge(args: ORAMConfig)
pub fn resize2fs_enlarge(args: ORAMConfig)
Run resize2fs on the ORAM file
Sourcepub fn get_passphrase() -> String
pub fn get_passphrase() -> String
Interactively ask the passphrase from the user
Sourcepub fn get_passphrase_first_time() -> String
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