Struct wow_srp::PublicKey[][src]

pub struct PublicKey { /* fields omitted */ }

Represents a public key for both the client and server.

This is used instead of a raw array in order to move the error from verifying the key out of the proof functions in order to increase readability.

Will return an error if all elements are 0, or the bytes represented as an integer modulus the large safe prime is equal to 0. Since the large safe prime multiplied by 2 results in a 33 byte value it is unrepresentable as a public key and thus the only two failure opportunities are if the key is exactly zero or if it is exactly equal to the large safe prime.

Implementations

impl PublicKey[src]

pub const fn as_le(&self) -> &[u8; 32][src]

Returns the value as little endian bytes.

The bytes are stored internally as little endian, so this causes no reversal.

impl PublicKey[src]

pub fn from_le_bytes(key: &[u8; 32]) -> Result<Self, InvalidPublicKeyError>[src]

Creates the struct from little endian bytes.

Values are stored internally as little endian so no reversal occurs.

Trait Implementations

impl Debug for PublicKey[src]

impl Eq for PublicKey[src]

impl PartialEq<PublicKey> for PublicKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,