[][src]Struct tox_packet::dht::CryptoHandshakePayload

pub struct CryptoHandshakePayload {
    pub base_nonce: Nonce,
    pub session_pk: PublicKey,
    pub cookie_hash: Digest,
    pub cookie: EncryptedCookie,
}

Unencrypted payload of CryptoHandshake packet.

Serialized form:

LengthContent
24Nonce
32Session PublicKey
64SHA512 hash of the cookie
24Nonce for the cookie
88Cookie

Fields

base_nonce: Nonce

Nonce that should be used to encrypt each data packet, adding 1 to it for each data packet sent.

session_pk: PublicKey

Temporary session key used to encrypt data packets to achieve perfect forward secrecy.

cookie_hash: Digest

SHA512 hash of the encrypted cookie from CryptoHandshake packet. It's used to make sure that possible attacker can't combine payload from old CryptoHandshake with new Cookie and try to do mess sending such packets.

cookie: EncryptedCookie

Encrypted cookie of sender of CryptoHandshake packet. When node receives CryptoHandshake it can take this cookie instead of sending CookieRequest to obtain one.

Trait Implementations

impl Clone for CryptoHandshakePayload[src]

impl Debug for CryptoHandshakePayload[src]

impl Eq for CryptoHandshakePayload[src]

impl FromBytes for CryptoHandshakePayload[src]

impl PartialEq<CryptoHandshakePayload> for CryptoHandshakePayload[src]

impl StructuralEq for CryptoHandshakePayload[src]

impl StructuralPartialEq for CryptoHandshakePayload[src]

impl ToBytes for CryptoHandshakePayload[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.