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 pointshared_out: must be at least 56 bytes; receives the shared secret
Low-order public keys are rejected with CryptoError::Kex.
Trait Implementations§
Source§impl KeyAgreement for X448
impl KeyAgreement for X448
Source§fn agree(
&self,
my_secret: &[u8],
their_public: &[u8],
shared_out: &mut [u8],
) -> Result<(), CryptoError>
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 scalar_len(&self) -> usize
fn scalar_len(&self) -> usize
Length of the scalar (private key) in bytes.
Length of the shared secret in bytes. Read more
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more