Trait cypher::Ecdh

source ·
pub trait Ecdh: EcSk {
    type SharedSecret: Copy + Eq + Sized + Send + AsRef<[u8]>;

    // Required method
    fn ecdh(&self, pk: &Self::Pk) -> Result<Self::SharedSecret, EcdhError>;
}
Expand description

Elliptic-curve based public key type which can be used for ECDH.

Safety

The type provides no guarantees on the key validity upon deserialization.

Required Associated Types§

Required Methods§

source

fn ecdh(&self, pk: &Self::Pk) -> Result<Self::SharedSecret, EcdhError>

Implementations on Foreign Types§

source§

impl Ecdh for SecretKey

§

type SharedSecret = [u8; 32]

source§

fn ecdh(&self, pk: &Self::Pk) -> Result<Self::SharedSecret, EcdhError>

Implementors§