cryptraits/
key_exchange.rs

1//! Key exchange traits.
2
3use zeroize::Zeroize;
4
5use super::key::{PublicKey, SharedSecretKey};
6
7/// Diffie-Hellman key exchange.
8pub trait DiffieHellman: Zeroize {
9    type SSK: SharedSecretKey;
10    type PK: PublicKey;
11
12    /// Derives `SharedSecretKey` from the other `PublicKey`
13    fn diffie_hellman(&self, peer_public: &Self::PK) -> Self::SSK;
14}