From e2f809d46751c43f9949a727eb23f0e1a60d7177 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 16 Jan 2025 13:39:46 -0800 Subject: [PATCH] chacha20_poly1305_openssh: Reformat `seal_in_place` (NFC). --- src/aead/chacha20_poly1305_openssh.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/aead/chacha20_poly1305_openssh.rs b/src/aead/chacha20_poly1305_openssh.rs index 027f1c300..e47db8870 100644 --- a/src/aead/chacha20_poly1305_openssh.rs +++ b/src/aead/chacha20_poly1305_openssh.rs @@ -70,17 +70,15 @@ impl SealingKey { let mut counter = make_counter(sequence_number); let poly_key = derive_poly1305_key(&self.key.k_2, counter.increment()); - { - let (len_in_out, data_and_padding_in_out) = - plaintext_in_ciphertext_out.split_at_mut(PACKET_LENGTH_LEN); - - self.key - .k_1 - .encrypt_in_place(make_counter(sequence_number), len_in_out); - self.key - .k_2 - .encrypt_in_place(counter, data_and_padding_in_out); - } + let (len_in_out, data_and_padding_in_out) = + plaintext_in_ciphertext_out.split_at_mut(PACKET_LENGTH_LEN); + + self.key + .k_1 + .encrypt_in_place(make_counter(sequence_number), len_in_out); + self.key + .k_2 + .encrypt_in_place(counter, data_and_padding_in_out); let Tag(tag) = poly1305::sign(poly_key, plaintext_in_ciphertext_out, cpu_features); *tag_out = tag;