Struct ssh_packet::cryptography::EcdhExchange

source ·
pub struct EcdhExchange<'e> {
    pub v_c: &'e Bytes,
    pub v_s: &'e Bytes,
    pub i_c: &'e Bytes,
    pub i_s: &'e Bytes,
    pub k_s: &'e Bytes,
    pub q_c: &'e Bytes,
    pub q_s: &'e Bytes,
    pub k: &'e MpInt,
}
Expand description

The exchange hash for ECDH, computed as the hash of the concatenation of the following.

see https://datatracker.ietf.org/doc/html/rfc5656#section-4.

Fields§

§v_c: &'e Bytes

Client’s identification string (\r and \n excluded).

§v_s: &'e Bytes

Server’s identification string (\r and \n excluded).

§i_c: &'e Bytes

Payload of the client’s SSH_MSG_KEXINIT message.

§i_s: &'e Bytes

Payload of the server’s SSH_MSG_KEXINIT message.

§k_s: &'e Bytes

Server’s public host key.

§q_c: &'e Bytes

Client’s ephemeral public key octet string.

§q_s: &'e Bytes

Server’s ephemeral public key octet string.

§k: &'e MpInt

Computed shared secret.

Implementations§

source§

impl EcdhExchange<'_>

source

pub fn hash<D: Digest>(&self) -> Output<D>

Available on crate feature digest only.

Produce the exchange hash with the specified digest algorithm.

Trait Implementations§

source§

impl<'e> BinWrite for EcdhExchange<'e>

§

type Args<'__binrw_generated_args_lifetime> = ()

The type used for the args parameter of write_args() and write_options(). Read more
source§

fn write_options<W: Write + Seek>( &self, __binrw_generated_var_writer: &mut W, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<()>

Write Self to the writer using the given Endian and arguments. Read more
source§

fn write<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self: WriteEndian, Self::Args<'a>: for<'a> Required,

Write Self to the writer using default arguments. Read more
source§

fn write_be<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self::Args<'a>: for<'a> Required,

Write Self to the writer assuming big-endian byte order. Read more
source§

fn write_le<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek, Self::Args<'a>: for<'a> Required,

Write Self to the writer assuming little-endian byte order. Read more
source§

fn write_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek, Self: WriteEndian,

Write Self to the writer using the given arguments. Read more
source§

fn write_be_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek,

Write Self to the writer, assuming big-endian byte order, using the given arguments. Read more
source§

fn write_le_args<W>( &self, writer: &mut W, args: Self::Args<'_>, ) -> Result<(), Error>
where W: Write + Seek,

Write Self to the writer, assuming little-endian byte order, using the given arguments. Read more
source§

impl<'e> Clone for EcdhExchange<'e>

source§

fn clone(&self) -> EcdhExchange<'e>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'e> Debug for EcdhExchange<'e>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'e> WriteEndian for EcdhExchange<'e>

source§

const ENDIAN: EndianKind = _

The endianness of the type.

Auto Trait Implementations§

§

impl<'e> Freeze for EcdhExchange<'e>

§

impl<'e> RefUnwindSafe for EcdhExchange<'e>

§

impl<'e> Send for EcdhExchange<'e>

§

impl<'e> Sync for EcdhExchange<'e>

§

impl<'e> Unpin for EcdhExchange<'e>

§

impl<'e> UnwindSafe for EcdhExchange<'e>

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.