ECDHEncrypt

Trait ECDHEncrypt 

Source
pub trait ECDHEncrypt {
    // Required method
    fn encrypt<R: RngCore>(
        &self,
        rng: &mut R,
        plaintext: &[u8],
        public_key: &[u8],
    ) -> Result<Vec<u8>>;
}
Expand description

Trait for ECDH encryption operations.

This trait allows different ECDH implementations to be used polymorphically. Currently not used in the public API but available for extension.

Required Methods§

Source

fn encrypt<R: RngCore>( &self, rng: &mut R, plaintext: &[u8], public_key: &[u8], ) -> Result<Vec<u8>>

Encrypt plaintext to a public key using ECDH.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§