From b5f73c0d5e33fdf899fa86bb77006ca79363168f 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 7bd7a620a..e8fcc8e37 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;