pub struct EphemeralKey { /* private fields */ }Expand description
Ephemeral X25519 keypair for one feed handshake.
Implementations§
Source§impl EphemeralKey
impl EphemeralKey
Sourcepub fn public_bytes(&self) -> [u8; 32]
pub fn public_bytes(&self) -> [u8; 32]
32-byte X25519 public key sent in enc/1=<64-hex>.
Sourcepub fn derive_feed_key(
self,
peer_pk: [u8; 32],
is_outlet: bool,
psk: Option<&str>,
) -> Result<[u8; 32]>
pub fn derive_feed_key( self, peer_pk: [u8; 32], is_outlet: bool, psk: Option<&str>, ) -> Result<[u8; 32]>
Complete X25519 key agreement and derive the outlet-to-inlet ChaCha20-Poly1305 session key via HKDF-SHA256.
inlet_pk and outlet_pk are bound into the HKDF salt together
with any optional pre-shared key so both sides agree on the exact
transcript.
Auto Trait Implementations§
impl Forget for EphemeralKey
impl Freeze for EphemeralKey
impl Move for EphemeralKey
impl RefUnwindSafe for EphemeralKey
impl Send for EphemeralKey
impl Sync for EphemeralKey
impl Unpin for EphemeralKey
impl UnsafeUnpin for EphemeralKey
impl UnwindSafe for EphemeralKey
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