pub struct PakeSide {
pub msg_out: Vec<u8>,
/* private fields */
}Expand description
One side of a SPAKE2 handshake. Created with the shared code phrase + a pairing identity (e.g. relay pair-slot id) so distinct pairings can’t be confused.
Fields§
§msg_out: Vec<u8>Implementations§
Source§impl PakeSide
impl PakeSide
Sourcepub fn new(code_phrase: &str, pair_id: &[u8]) -> Self
pub fn new(code_phrase: &str, pair_id: &[u8]) -> Self
Create our side. code_phrase is the human-typed string; pair_id
is a per-pairing identity (e.g. relay pair-slot id) to prevent
crosstalk between concurrent pairings.
Sourcepub fn from_seed(code_phrase: &str, pair_id: &[u8], seed: [u8; 32]) -> Self
pub fn from_seed(code_phrase: &str, pair_id: &[u8], seed: [u8; 32]) -> Self
Create with a deterministic seeded RNG. Same (code_phrase, pair_id, seed) triple produces the same state + msg_out, so a process can
persist seed to disk and reconstruct an equivalent PakeSide after
restart. SECURITY: the seed combined with the code phrase reconstructs
the SPAKE2 secret scalar; treat the seed as sensitive (caller is
responsible for storing it in a directory with user-only file
permissions, like $WIRE_HOME/state/wire/pending-pair/).