Skip to main content

ProverConfirming

Struct ProverConfirming 

Source
pub struct ProverConfirming<S: Suite> { /* private fields */ }
Expand description

The prover holding both confirmations, waiting for confirmV.

It is zeroized on drop, and its Debug shows nothing.

Implementations§

Source§

impl<S: Suite> ProverConfirming<S>

Source

pub fn finish( self, confirm_v: &ConfirmV<S>, ) -> Result<(ConfirmP<S>, SharedKey<S>), Error>

Checks the verifier’s confirmation, in constant time, and only then gives the prover’s confirmation, to send, and the shared key: the order RFC 9383 requires.

§Errors

Error::ConfirmationFailed when confirmV does not match: the verifier holds another password, context or identity, or the messages were altered. Send nothing more.

Source

pub fn confirm_first(self) -> (ConfirmP<S>, ProverConfirmedFirst<S>)

Gives the prover’s confirmation before the verifier’s has arrived, for protocols that send it first (TP-Link’s TPAP sends shareP and confirmP together after receiving shareV). The shared key still waits for the verifier’s confirmation.

§Security

This departs from RFC 9383, which has the prover check confirmV before sending confirmP. confirmP is a MAC keyed by the password, so an impostor posing as the verifier, who sent its own shareV, can test password guesses against it offline, without ever proving it knows the record. Use it only when the protocol forces this order, and with a password hash slow enough to make those guesses expensive.

Trait Implementations§

Source§

impl<S: Suite> Debug for ProverConfirming<S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> Freeze for ProverConfirming<S>
where Keys<S>: Freeze,

§

impl<S> RefUnwindSafe for ProverConfirming<S>
where Keys<S>: RefUnwindSafe,

§

impl<S> Send for ProverConfirming<S>
where Keys<S>: Send,

§

impl<S> Sync for ProverConfirming<S>
where Keys<S>: Sync,

§

impl<S> Unpin for ProverConfirming<S>
where Keys<S>: Unpin,

§

impl<S> UnsafeUnpin for ProverConfirming<S>
where Keys<S>: UnsafeUnpin,

§

impl<S> UnwindSafe for ProverConfirming<S>
where Keys<S>: 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 = !

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.