From 4f65d897e3ba85f18d7958af1089d45acb3a98ec 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 39b9e7f0b..027f1c300 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,