Struct mls_rs_crypto_openssl::ecdh::Ecdh
source · pub struct Ecdh(/* private fields */);Implementations§
Methods from Deref<Target = Curve>§
sourcepub fn secret_key_size(&self) -> usize
pub fn secret_key_size(&self) -> usize
Returns the amount of bytes of a secret key using this curve
pub fn public_key_size(&self) -> usize
pub fn curve_bitmask(&self) -> Option<u8>
Trait Implementations§
source§impl DhType for Ecdh
impl DhType for Ecdh
type Error = EcdhKemError
fn dh( &self, secret_key: &HpkeSecretKey, public_key: &HpkePublicKey ) -> Result<Vec<u8>, Self::Error>
source§fn to_public(
&self,
secret_key: &HpkeSecretKey
) -> Result<HpkePublicKey, Self::Error>
fn to_public( &self, secret_key: &HpkeSecretKey ) -> Result<HpkePublicKey, Self::Error>
Outputs the public key corresponding to the given secret key bytes. If the secret
key is malformed, the function should return an error.
source§fn generate(&self) -> Result<(HpkeSecretKey, HpkePublicKey), Self::Error>
fn generate(&self) -> Result<(HpkeSecretKey, HpkePublicKey), Self::Error>
Generate a fresh key pair. This is the only place where randomness is used in this
module. The function could be implemented in the same way as
derive with random
ikm, but it could also be implemented directly with a crypto provider like OpenSSL.source§fn bitmask_for_rejection_sampling(&self) -> Option<u8>
fn bitmask_for_rejection_sampling(&self) -> Option<u8>
If the output is
Some(bitmask), then the Kem::derive function will generate
the secret key by rejection sampling over random byte sequences with bitmask
applied to the most significant byte. Read morefn public_key_validate(&self, key: &HpkePublicKey) -> Result<(), Self::Error>
fn secret_key_size(&self) -> usize
source§impl PartialEq for Ecdh
impl PartialEq for Ecdh
impl Eq for Ecdh
impl StructuralEq for Ecdh
impl StructuralPartialEq for Ecdh
Auto Trait Implementations§
impl RefUnwindSafe for Ecdh
impl Send for Ecdh
impl Sync for Ecdh
impl Unpin for Ecdh
impl UnwindSafe for Ecdh
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