pub trait KeyAgreement: Algorithm {
const PRIVATE_KEY_LEN: usize;
const PUBLIC_KEY_LEN: usize;
const SHARED_SECRET_LEN: usize;
// Required methods
fn public_key(private_key: &[u8], out: &mut [u8]) -> Result<()>;
fn agree(
private_key: &[u8],
peer_public_key: &[u8],
out: &mut [u8],
) -> Result<()>;
}Expand description
A Diffie-Hellman style key agreement scheme.
Required Associated Constants§
Sourceconst PRIVATE_KEY_LEN: usize
const PRIVATE_KEY_LEN: usize
Private key (scalar) length in bytes.
Sourceconst PUBLIC_KEY_LEN: usize
const PUBLIC_KEY_LEN: usize
Public key (encoded point) length in bytes.
Sourceconst SHARED_SECRET_LEN: usize
const SHARED_SECRET_LEN: usize
Shared secret length in bytes.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".