We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edb7533 commit 3c4fe80Copy full SHA for 3c4fe80
lightning/src/ln/inbound_payment.rs
@@ -90,11 +90,7 @@ impl ExpandedKey {
90
/// Encrypts or decrypts the given `bytes`. Used for data included in an offer message's
91
/// metadata (e.g., payment id).
92
pub(crate) fn crypt_for_offer(&self, mut bytes: [u8; 32], nonce: Nonce) -> [u8; 32] {
93
- let chacha_block = ChaCha20::get_single_block(&self.offers_encryption_key, &nonce.0);
94
- for i in 0..bytes.len() {
95
- bytes[i] = chacha_block[i] ^ bytes[i];
96
- }
97
-
+ ChaCha20::encrypt_single_block_in_place(&self.offers_encryption_key, &nonce.0, &mut bytes);
98
bytes
99
}
100
0 commit comments