Struct Spake2

Source
pub struct Spake2<G: Group> { /* private fields */ }
Expand description

SPAKE2 algorithm.

Implementations§

Source§

impl<G: Group> Spake2<G>

Source

pub fn start_a( password: &Password, id_a: &Identity, id_b: &Identity, ) -> (Spake2<G>, Vec<u8>)

Available on crate feature getrandom only.

Start with identity idA.

Uses the system RNG.

Source

pub fn start_b( password: &Password, id_a: &Identity, id_b: &Identity, ) -> (Spake2<G>, Vec<u8>)

Available on crate feature getrandom only.

Start with identity idB.

Uses the system RNG.

Source

pub fn start_symmetric( password: &Password, id_s: &Identity, ) -> (Spake2<G>, Vec<u8>)

Available on crate feature getrandom only.

Start with symmetric identity.

Uses the system RNG.

Source

pub fn start_a_with_rng( password: &Password, id_a: &Identity, id_b: &Identity, csrng: impl CryptoRng + RngCore, ) -> (Spake2<G>, Vec<u8>)

Start with identity idA and the provided cryptographically secure RNG.

Source

pub fn start_b_with_rng( password: &Password, id_a: &Identity, id_b: &Identity, csrng: impl CryptoRng + RngCore, ) -> (Spake2<G>, Vec<u8>)

Start with identity idB and the provided cryptographically secure RNG.

Source

pub fn start_symmetric_with_rng( password: &Password, id_s: &Identity, csrng: impl CryptoRng + RngCore, ) -> (Spake2<G>, Vec<u8>)

Start with symmetric identity and the provided cryptographically secure RNG.

Source

pub fn finish(self, msg2: &[u8]) -> Result<Vec<u8>>

Finish SPAKE2.

Trait Implementations§

Source§

impl<G: Group> Debug for Spake2<G>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<G: PartialEq + Group> PartialEq for Spake2<G>
where G::Scalar: PartialEq,

Source§

fn eq(&self, other: &Spake2<G>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<G: Eq + Group> Eq for Spake2<G>
where G::Scalar: Eq,

Source§

impl<G: Group> StructuralPartialEq for Spake2<G>

Auto Trait Implementations§

§

impl<G> Freeze for Spake2<G>
where <G as Group>::Scalar: Freeze,

§

impl<G> RefUnwindSafe for Spake2<G>
where <G as Group>::Scalar: RefUnwindSafe,

§

impl<G> Send for Spake2<G>
where <G as Group>::Scalar: Send,

§

impl<G> Sync for Spake2<G>
where <G as Group>::Scalar: Sync,

§

impl<G> Unpin for Spake2<G>
where <G as Group>::Scalar: Unpin,

§

impl<G> UnwindSafe for Spake2<G>
where <G as Group>::Scalar: UnwindSafe,

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.