pub struct Handshake<const KEY_LENGTH: usize, const SALT_LENGTH: usize> {
pub B: PublicKey,
pub g: Generator,
pub N: PrimeModulus,
pub k: MultiplierParameter,
pub s: Salt,
}
Expand description
Contains all variables needed for a successful session key generation provided by the server to the client
Fields
B: PublicKey
the servers public key
g: Generator
a generator modulo N
N: PrimeModulus
a big and safe prime number
k: MultiplierParameter
multiplier parameter
s: Salt
the users salt
Implementations
sourceimpl<const KEY_LENGTH: usize, const SALT_LENGTH: usize> Handshake<KEY_LENGTH, SALT_LENGTH>
impl<const KEY_LENGTH: usize, const SALT_LENGTH: usize> Handshake<KEY_LENGTH, SALT_LENGTH>
sourcepub fn calculate_proof(
&self,
username: UsernameRef<'_>,
password: &ClearTextPassword
) -> Result<(HandshakeProof<KEY_LENGTH, SALT_LENGTH>, StrongProofVerifier<KEY_LENGTH>)>
pub fn calculate_proof(
&self,
username: UsernameRef<'_>,
password: &ClearTextPassword
) -> Result<(HandshakeProof<KEY_LENGTH, SALT_LENGTH>, StrongProofVerifier<KEY_LENGTH>)>
client proof calculation User: x = H(s, p) (user enters password) User: S = (B - kg^x) ^ (a + ux) (computes session key) User: K = H(S)
Trait Implementations
Auto Trait Implementations
impl<const KEY_LENGTH: usize, const SALT_LENGTH: usize> RefUnwindSafe for Handshake<KEY_LENGTH, SALT_LENGTH>
impl<const KEY_LENGTH: usize, const SALT_LENGTH: usize> Send for Handshake<KEY_LENGTH, SALT_LENGTH>
impl<const KEY_LENGTH: usize, const SALT_LENGTH: usize> Sync for Handshake<KEY_LENGTH, SALT_LENGTH>
impl<const KEY_LENGTH: usize, const SALT_LENGTH: usize> Unpin for Handshake<KEY_LENGTH, SALT_LENGTH>
impl<const KEY_LENGTH: usize, const SALT_LENGTH: usize> UnwindSafe for Handshake<KEY_LENGTH, SALT_LENGTH>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more