Skip to main content

X448

Struct X448 

Source
pub struct X448;
Expand description

X448 Diffie-Hellman key agreement (RFC 7748 §5).

  • my_secret: 56-byte scalar (clamped per RFC 7748)
  • their_public: 56-byte Montgomery-form public point
  • shared_out: must be at least 56 bytes; receives the shared secret

Low-order public keys are rejected with CryptoError::Kex.

Trait Implementations§

Source§

impl Clone for X448

Source§

fn clone(&self) -> X448

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for X448

Source§

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

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

impl Default for X448

Source§

fn default() -> X448

Returns the “default value” for a type. Read more
Source§

impl KeyAgreement for X448

Source§

fn agree( &self, my_secret: &[u8], their_public: &[u8], shared_out: &mut [u8], ) -> Result<(), CryptoError>

Perform X448 DH and write the 56-byte shared secret into shared_out.

§Errors

Returns CryptoError::InvalidKey if either my_secret or their_public is not exactly 56 bytes, and CryptoError::Kex if their_public is a low-order point or the resulting shared secret is all-zero.

Source§

fn name(&self) -> &'static str

Human-readable algorithm identifier (e.g. "X25519").
Source§

fn scalar_len(&self) -> usize

Length of the scalar (private key) in bytes.
Source§

fn point_len(&self) -> usize

Length of the public point in bytes.
Source§

fn shared_secret_len(&self) -> usize

Length of the shared secret in bytes. Read more
Source§

fn agree_to_vec( &self, my_secret: &[u8], their_public: &[u8], ) -> Result<Vec<u8>, CryptoError>

Convenience: perform ECDH and return the shared secret as a Vec<u8>. Read more
Source§

impl Copy for X448

Auto Trait Implementations§

§

impl Freeze for X448

§

impl RefUnwindSafe for X448

§

impl Send for X448

§

impl Sync for X448

§

impl Unpin for X448

§

impl UnsafeUnpin for X448

§

impl UnwindSafe for X448

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,