Struct spake2::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<Spake2<G>> for Spake2<G>where G::Scalar: PartialEq,

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> StructuralEq for Spake2<G>

source§

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

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.