Skip to main content

StretchedMaster

Struct StretchedMaster 

Source
pub struct StretchedMaster { /* private fields */ }
Expand description

A high-entropy 32-byte master for ALL of a user’s key derivations — the per-audience AEAD keys AND the X25519/Ed25519 identities derive from THIS (via HKDF), never from a raw passphrase. The type is the gate: an identity or audience key cannot be derived from an unstretched password, because those functions take &StretchedMaster, and the only ways to build one are the two constructors below.

Implementations§

Source§

impl StretchedMaster

Source

pub fn from_passphrase(passphrase: &[u8], user_id: &str) -> Self

Argon2id-stretch a (password-equivalent) passphrase into the master, deterministically per user (see [argon2_salt]).

SECURITY — mitigation, NOT closure: this raises the per-guess cost of a weak passphrase but cannot mint entropy it never had. The user’s identity PUBLIC key is published (the platform maps account_id → pubkey), which is an OFFLINE verification oracle — an attacker guesses a passphrase, stretches, derives, and compares to the published key with NO network. Argon2id’s per-guess cost is then the entire wall; a short password still falls. A PAKE removes the oracle and is the strictly stronger path. Passphrase policy, param benchmarking, and the PAKE alternative still require a cryptographer before production.

Source

pub fn from_issued_high_entropy(secret: &[u8], user_id: &str) -> Self

From a Parslee-issued high-entropy secret (the caller CERTIFIES it is ≥256-bit). Skips Argon2id — stretching a strong key is pointless cost — and HKDF-binds it to user_id for per-user domain separation.

Source

pub fn profile(&self) -> KdfProfile

The profile that minted this master (for the rotation/migration machinery).

Trait Implementations§

Source§

impl Debug for StretchedMaster

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more