pub struct X25519;Trait Implementations§
Source§impl EcdhArrayref<RAND_LEN, SECRET_LEN, PUBLIC_LEN> for X25519
impl EcdhArrayref<RAND_LEN, SECRET_LEN, PUBLIC_LEN> for X25519
Source§fn generate_secret(
secret: &mut [U8; 32],
rand: &[U8; 32],
) -> Result<(), GenerateSecretError>
fn generate_secret( secret: &mut [U8; 32], rand: &[U8; 32], ) -> Result<(), GenerateSecretError>
Generate a Diffie-Hellman secret value.
It is the responsibility of the caller to ensure that the
rand argument is actually
random.Source§fn secret_to_public(
public: &mut [u8; 32],
secret: &[U8; 32],
) -> Result<(), SecretToPublicError>
fn secret_to_public( public: &mut [u8; 32], secret: &[U8; 32], ) -> Result<(), SecretToPublicError>
Derive a Diffie-Hellman public value from a secret value.
Source§fn derive_ecdh(
derived: &mut [U8; 32],
public: &[u8; 32],
secret: &[U8; 32],
) -> Result<(), DeriveError>
fn derive_ecdh( derived: &mut [U8; 32], public: &[u8; 32], secret: &[U8; 32], ) -> Result<(), DeriveError>
Derive a Diffie-Hellman shared secret from a public and a
secret value. Read more
Source§fn validate_secret(secret: &[U8; 32]) -> Result<(), ValidateSecretError>
fn validate_secret(secret: &[U8; 32]) -> Result<(), ValidateSecretError>
Check the validity of a Diffie-Hellman secret value.
Source§fn generate_pair(
public: &mut [u8; PUBLIC_LEN],
secret: &mut [u8; SECRET_LEN],
rand: &[u8; RAND_LEN],
) -> Result<(), GenerateSecretError>
fn generate_pair( public: &mut [u8; PUBLIC_LEN], secret: &mut [u8; SECRET_LEN], rand: &[u8; RAND_LEN], ) -> Result<(), GenerateSecretError>
Generate a Diffie-Hellman secret value and derive the
corresponding public value in one step.
Source§impl EcdhSlice for X25519
impl EcdhSlice for X25519
Source§fn generate_secret(
secret: &mut [U8],
rand: &[U8],
) -> Result<(), GenerateSecretError>
fn generate_secret( secret: &mut [U8], rand: &[U8], ) -> Result<(), GenerateSecretError>
Generate a Diffie-Hellman secret value.
It is the responsibility of the caller to ensure that the
rand argument is actually
random.Source§fn secret_to_public(
public: &mut [u8],
secret: &[U8],
) -> Result<(), SecretToPublicError>
fn secret_to_public( public: &mut [u8], secret: &[U8], ) -> Result<(), SecretToPublicError>
Derive a Diffie-Hellman public value from a secret value.
Source§fn derive_ecdh(
derived: &mut [U8],
public: &[u8],
secret: &[U8],
) -> Result<(), DeriveError>
fn derive_ecdh( derived: &mut [U8], public: &[u8], secret: &[U8], ) -> Result<(), DeriveError>
Derive a Diffie-Hellman shared secret from a public and a
secret value. Read more
Source§fn validate_secret(secret: &[U8]) -> Result<(), ValidateSecretError>
fn validate_secret(secret: &[U8]) -> Result<(), ValidateSecretError>
Check the validity of a Diffie-Hellman secret value.
Source§fn generate_pair(
public: &mut [u8],
secret: &mut [u8],
rand: &[u8],
) -> Result<(), GenerateSecretError>
fn generate_pair( public: &mut [u8], secret: &mut [u8], rand: &[u8], ) -> Result<(), GenerateSecretError>
Generate a Diffie-Hellman secret value and derive the
corresponding public value in one step.
Source§impl Kem<DK_LEN, EK_LEN, EK_LEN, SS_LEN, DK_LEN, DK_LEN> for X25519
impl Kem<DK_LEN, EK_LEN, EK_LEN, SS_LEN, DK_LEN, DK_LEN> for X25519
Source§fn keygen(
ek: &mut [u8; 32],
dk: &mut [U8; 32],
rand: &[U8; 32],
) -> Result<(), KeyGenError>
fn keygen( ek: &mut [u8; 32], dk: &mut [U8; 32], rand: &[U8; 32], ) -> Result<(), KeyGenError>
Generate a pair of encapsulation and decapsulation keys.
It is the responsibility of the caller to ensure that the
rand argument is actually
random.Source§impl Kem for X25519
impl Kem for X25519
Source§fn keygen(ek: &mut [u8], dk: &mut [U8], rand: &[U8]) -> Result<(), KeyGenError>
fn keygen(ek: &mut [u8], dk: &mut [U8], rand: &[U8]) -> Result<(), KeyGenError>
Generate a pair of encapsulation and decapsulation keys.
It is the responsibility of the caller to ensure that the
rand argument is actually
random.Auto Trait Implementations§
impl Freeze for X25519
impl RefUnwindSafe for X25519
impl Send for X25519
impl Sync for X25519
impl Unpin for X25519
impl UnwindSafe for X25519
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
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<const RAND_LEN: usize, const SECRET_LEN: usize, const PUBLIC_LEN: usize, T> EcdhOwned<RAND_LEN, SECRET_LEN, PUBLIC_LEN> for Twhere
T: EcdhArrayref<RAND_LEN, SECRET_LEN, PUBLIC_LEN>,
impl<const RAND_LEN: usize, const SECRET_LEN: usize, const PUBLIC_LEN: usize, T> EcdhOwned<RAND_LEN, SECRET_LEN, PUBLIC_LEN> for Twhere
T: EcdhArrayref<RAND_LEN, SECRET_LEN, PUBLIC_LEN>,
Source§fn generate_secret(
rand: &[u8; RAND_LEN],
) -> Result<[u8; SECRET_LEN], GenerateSecretError>
fn generate_secret( rand: &[u8; RAND_LEN], ) -> Result<[u8; SECRET_LEN], GenerateSecretError>
Generate a Diffie-Hellman secret value.
It is the responsibility of the caller to ensure that the
rand argument is actually
random.Source§fn secret_to_public(
secret: &[u8; SECRET_LEN],
) -> Result<[u8; PUBLIC_LEN], SecretToPublicError>
fn secret_to_public( secret: &[u8; SECRET_LEN], ) -> Result<[u8; PUBLIC_LEN], SecretToPublicError>
Derive a Diffie-Hellman public value from a secret value.
Source§fn derive_ecdh(
public: &[u8; PUBLIC_LEN],
secret: &[u8; SECRET_LEN],
) -> Result<[u8; PUBLIC_LEN], DeriveError>
fn derive_ecdh( public: &[u8; PUBLIC_LEN], secret: &[u8; SECRET_LEN], ) -> Result<[u8; PUBLIC_LEN], DeriveError>
Derive a Diffie-Hellman shared secret from a public and a
secret value. Read more
Source§fn validate_secret(secret: &[u8; SECRET_LEN]) -> Result<(), ValidateSecretError>
fn validate_secret(secret: &[u8; SECRET_LEN]) -> Result<(), ValidateSecretError>
Check the validity of a Diffie-Hellman secret value.
Source§fn generate_pair(
rand: &[u8; RAND_LEN],
) -> Result<([u8; PUBLIC_LEN], [u8; SECRET_LEN]), GenerateSecretError>
fn generate_pair( rand: &[u8; RAND_LEN], ) -> Result<([u8; PUBLIC_LEN], [u8; SECRET_LEN]), GenerateSecretError>
Generate a Diffie-Hellman secret value and derive the
corresponding public value in one step.
Source§impl<const EK_LEN: usize, const DK_LEN: usize, const CT_LEN: usize, const SS_LEN: usize, const RAND_KEYGEN_LEN: usize, const RAND_ENCAPS_LEN: usize, T> Kem<EK_LEN, DK_LEN, CT_LEN, SS_LEN, RAND_KEYGEN_LEN, RAND_ENCAPS_LEN> for Twhere
T: Kem<EK_LEN, DK_LEN, CT_LEN, SS_LEN, RAND_KEYGEN_LEN, RAND_ENCAPS_LEN>,
impl<const EK_LEN: usize, const DK_LEN: usize, const CT_LEN: usize, const SS_LEN: usize, const RAND_KEYGEN_LEN: usize, const RAND_ENCAPS_LEN: usize, T> Kem<EK_LEN, DK_LEN, CT_LEN, SS_LEN, RAND_KEYGEN_LEN, RAND_ENCAPS_LEN> for Twhere
T: Kem<EK_LEN, DK_LEN, CT_LEN, SS_LEN, RAND_KEYGEN_LEN, RAND_ENCAPS_LEN>,
Source§fn keygen(
rand: &[u8; RAND_KEYGEN_LEN],
) -> Result<([u8; DK_LEN], [u8; EK_LEN]), KeyGenError>
fn keygen( rand: &[u8; RAND_KEYGEN_LEN], ) -> Result<([u8; DK_LEN], [u8; EK_LEN]), KeyGenError>
Generate a pair of encapsulation and decapsulation keys.
It is the responsibility of the caller to ensure that the
rand argument is actually
random.