pub struct LinkKey { /* private fields */ }Expand description
A link’s derived session key: 64-byte AES-256 Token key (32-byte signing half ‖ 32-byte encryption half)
Implementations§
Source§impl LinkKey
impl LinkKey
pub fn derive(link_id: &LinkId, shared: &X25519SharedSecret) -> LinkKey
pub fn seal( &self, iv: &[u8; 16], plaintext: &[u8], out: &mut [u8], ) -> Result<usize, BufferTooShort>
pub fn seal_chunks( &self, iv: &[u8; 16], chunks: &[&[u8]], out: &mut [u8], ) -> Result<usize, BufferTooShort>
Sourcepub fn cloned(&self) -> LinkKey
pub fn cloned(&self) -> LinkKey
An owned duplicate for a crypto-pool job: the seal runs on a worker thread, which cannot borrow the links table.
pub fn seal_in_place( &self, iv: &[u8; 16], out: &mut [u8], plain_len: usize, ) -> Result<usize, BufferTooShort>
pub fn open( &self, token: &[u8], out: &mut [u8], ) -> Result<usize, TokenOpenError>
pub fn open_in_place<'t>( &self, token: &'t mut [u8], ) -> Result<&'t [u8], TokenOpenError>
Sourcepub fn open_stream(
&self,
iv: &[u8; 16],
token_len: usize,
) -> Result<TokenOpenStream, TokenOpenError>
pub fn open_stream( &self, iv: &[u8; 16], token_len: usize, ) -> Result<TokenOpenStream, TokenOpenError>
open_in_place for a token landing in contiguous spans.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkKey
impl RefUnwindSafe for LinkKey
impl Send for LinkKey
impl Sync for LinkKey
impl Unpin for LinkKey
impl UnsafeUnpin for LinkKey
impl UnwindSafe for LinkKey
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