Explorar o código

crypto/note: Lower the size of the decryption buffer to the minimum.

Luther Blissett %!s(int64=3) %!d(string=hai) anos
pai
achega
8fd40d5be4
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/crypto/note.rs

+ 1 - 1
src/crypto/note.rs

@@ -57,7 +57,7 @@ impl EncryptedNote {
         let shared_secret = sapling_ka_agree(secret, &self.ephem_public);
         let key = kdf_sapling(&shared_secret, &self.ephem_public);
 
-        let mut plaintext = vec![0; self.ciphertext.len()];
+        let mut plaintext = vec![0; self.ciphertext.len() - AEAD_TAG_SIZE];
 
         assert_eq!(
             ChachaPolyIetf::aead_cipher()