Explorar el Código

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

Luther Blissett hace 3 años
padre
commit
8fd40d5be4
Se han modificado 1 ficheros con 1 adiciones y 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()