Struct Ecdh

Source
pub struct Ecdh<'b> {
    pub v_c: Bytes<'b>,
    pub v_s: Bytes<'b>,
    pub i_c: Lengthed<&'b KexInit<'b>>,
    pub i_s: Lengthed<&'b KexInit<'b>>,
    pub k_s: Bytes<'b>,
    pub q_c: Bytes<'b>,
    pub q_s: Bytes<'b>,
    pub k: MpInt<'b>,
}
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: Bytes<'b>

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

§v_s: Bytes<'b>

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

§i_c: Lengthed<&'b KexInit<'b>>

Payload of the client’s SSH_MSG_KEXINIT message.

§i_s: Lengthed<&'b KexInit<'b>>

Payload of the server’s SSH_MSG_KEXINIT message.

§k_s: Bytes<'b>

Server’s public host key.

§q_c: Bytes<'b>

Client’s ephemeral public key octet string.

§q_s: Bytes<'b>

Server’s ephemeral public key octet string.

§k: MpInt<'b>

Computed shared secret.

Implementations§

Source§

impl Ecdh<'_>

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<'b> BinWrite for Ecdh<'b>

Source§

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<'b> Debug for Ecdh<'b>

Source§

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

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

impl<'b> WriteEndian for Ecdh<'b>

Source§

const ENDIAN: EndianKind

The endianness of the type.

Auto Trait Implementations§

§

impl<'b> Freeze for Ecdh<'b>

§

impl<'b> RefUnwindSafe for Ecdh<'b>

§

impl<'b> Send for Ecdh<'b>

§

impl<'b> Sync for Ecdh<'b>

§

impl<'b> Unpin for Ecdh<'b>

§

impl<'b> UnwindSafe for Ecdh<'b>

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> 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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.