Skip to main content

MasterKeySet

Struct MasterKeySet 

Source
pub struct MasterKeySet {
    pub k_tag: SecretKey,
    pub k_val: SecretKey,
    pub k_state: SecretKey,
    pub k_srch: SecretKey,
}
Expand description

The four secret keys that drive the entire RO(SE)² protocol. All four are derived deterministically from a user password + salt, so they can be re-derived on any device that knows the password.

Fields§

§k_tag: SecretKey

K_tag — derives EDB entry addresses (tags). tag = HMAC-SHA256(k_tag, "tag:" || keyword || index || epoch)

§k_val: SecretKey

K_val — encrypts document payloads stored in EDB entries. val_key = HMAC-SHA256(k_val, "val:" || keyword || index || epoch)

§k_state: SecretKey

K_state — encrypts the local ClientStateTable before persistence.

§k_srch: SecretKey

K_srch — derives per-search blinding factors (used in SWiSSSE phase).

Implementations§

Source§

impl MasterKeySet

Source

pub fn derive(password: &str, salt: &[u8; 16]) -> Result<Self, VaultError>

Derive a full MasterKeySet from a UTF-8 password and a 16-byte salt.

The salt must be unique per vault and stored alongside the encrypted state. It does NOT need to be secret.

§Errors

Returns VaultError::Kdf if Argon2 parameters are rejected (internal).

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