From 50cf4e190b43ba722f910e8f7ced8d7c6c106aac Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 16 Jan 2025 08:31:04 -0800 Subject: [PATCH] chacha20_poly1305_openssh: Document panic in `seal_in_place`. --- src/aead/chacha20_poly1305_openssh.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aead/chacha20_poly1305_openssh.rs b/src/aead/chacha20_poly1305_openssh.rs index 3037be487..d2cc5ced0 100644 --- a/src/aead/chacha20_poly1305_openssh.rs +++ b/src/aead/chacha20_poly1305_openssh.rs @@ -56,6 +56,10 @@ impl SealingKey { /// `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`. pub fn seal_in_place( &self, sequence_number: u32,