pub struct SealingKey { /* private fields */ }
Expand description
A key for sealing packets.
Implementations§
Source§impl SealingKey
impl SealingKey
Sourcepub fn seal_in_place(
&self,
sequence_number: u32,
plaintext_in_ciphertext_out: &mut [u8],
tag_out: &mut [u8; 16],
)
pub fn seal_in_place( &self, sequence_number: u32, plaintext_in_ciphertext_out: &mut [u8], tag_out: &mut [u8; 16], )
Seals (encrypts and signs) a packet.
On input, plaintext_in_ciphertext_out
must contain the unencrypted
packet_length||plaintext
where plaintext
is the
padding_length||payload||random padding
. It will be overwritten by
encrypted_packet_length||ciphertext
, where encrypted_packet_length
is encrypted with K_1
and ciphertext
is encrypted by K_2
.
§Panics
Panics if plaintext_in_ciphertext_out.len() < PACKET_LENGTH_LEN
.
Panics if plaintext_in_ciphertext_out
is longer than the maximum
input size for ChaCha20-Poly1305. Note that this limit is much,
much larger than SSH’s 256KB maximum record size.
Auto Trait Implementations§
impl Freeze for SealingKey
impl RefUnwindSafe for SealingKey
impl Send for SealingKey
impl Sync for SealingKey
impl Unpin for SealingKey
impl UnwindSafe for SealingKey
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