[][src]Struct shs_core::ServerAccept

pub struct ServerAccept(_);

Message 4

Server acknowledge (Server to Client)

The server accepts the handshake by signing a message using their long term secret key. It includes a copy of the client’s previous signature. The server’s signature is enclosed in a secret box using all of the shared secrets.

Upon receiving it, the client opens the box and verifies the server’s signature. Similarly to the previous message, this secret box also uses an all-zero nonce because it is the only secret box that ever uses the key sha256(concat(net_id, shared_secret_ab, shared_secret_aB, shared_secret_Ab)).

Server computes: detached_signature_B = nacl_sign_detached( msg: concat( network_identifier, detached_signature_A, client_longterm_pk, sha256(shared_secret_ab) ), key: server_longterm_sk )

Server sends (80 bytes): nacl_secret_box( msg: detached_signature_B, nonce: 24_bytes_of_zeros, key: sha256( concat( network_identifier, shared_secret_ab, shared_secret_aB, shared_secret_Ab ) ) )

Methods

impl ServerAccept[src]

pub fn new(
    sk: &ServerSecretKey,
    client_pk: &ClientPublicKey,
    net_id: &NetworkId,
    client_sig: &ClientSignature,
    shared_a: &SharedA,
    shared_b: &SharedB,
    shared_c: &SharedC
) -> ServerAccept
[src]

pub fn from_buffer(b: Vec<u8>) -> Option<ServerAccept>[src]

#[must_use]
pub fn open_and_verify(
    &self,
    client_sk: &ClientSecretKey,
    client_pk: &ClientPublicKey,
    server_pk: &ServerPublicKey,
    net_id: &NetworkId,
    shared_a: &SharedA,
    shared_b: &SharedB,
    shared_c: &SharedC
) -> bool
[src]

Client verifies: detached_signature_B = assert_nacl_secretbox_open( ciphertext: msg4, nonce: 24_bytes_of_zeros, key: sha256( concat( network_identifier, shared_secret_ab, shared_secret_aB, shared_secret_Ab )) )

assert_nacl_sign_verify_detached( sig: detached_signature_B, msg: concat( network_identifier, detached_signature_A, client_longterm_pk, sha256(shared_secret_ab) ), key: server_longterm_pk )

pub fn as_slice(&self) -> &[u8][src]

pub fn to_vec(&self) -> Vec<u8>[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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<T> Any for T where
    T: 'static + ?Sized
[src]