pub struct EcdhP256;Expand description
ECDH over P-256.
Implementations§
Source§impl EcdhP256
impl EcdhP256
Sourcepub fn public_key_compressed(private_key: &[u8], out: &mut [u8]) -> Result<()>
pub fn public_key_compressed(private_key: &[u8], out: &mut [u8]) -> Result<()>
Compute the public key in SEC1 compressed form (33 bytes).
Interoperates with TLS, COSE, and JOSE, which all prefer compressed
points. KeyAgreement::agree accepts either form.
Trait Implementations§
Source§impl KeyAgreement for EcdhP256
impl KeyAgreement for EcdhP256
Source§const PUBLIC_KEY_LEN: usize = 65
const PUBLIC_KEY_LEN: usize = 65
SEC1 uncompressed: 0x04 || X || Y.
Source§const PRIVATE_KEY_LEN: usize = 32
const PRIVATE_KEY_LEN: usize = 32
Private key (scalar) length in bytes.
Source§const SHARED_SECRET_LEN: usize = 32
const SHARED_SECRET_LEN: usize = 32
Shared secret length in bytes.
Auto Trait Implementations§
impl Freeze for EcdhP256
impl RefUnwindSafe for EcdhP256
impl Send for EcdhP256
impl Sync for EcdhP256
impl Unpin for EcdhP256
impl UnsafeUnpin for EcdhP256
impl UnwindSafe for EcdhP256
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