Add chunk IV to chunk MAC

This commit is contained in:
Moxie Marlinspike 2018-03-02 10:23:30 -08:00
parent 24e573e537
commit 3970a30e14
2 changed files with 2 additions and 0 deletions

View File

@ -256,6 +256,7 @@ public class FullBackupExporter extends FullBackupBase {
try {
Conversions.intToByteArray(iv, 0, counter++);
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(cipherKey, "AES"), new IvParameterSpec(iv));
mac.update(iv);
byte[] buffer = new byte[8192];
int read;

View File

@ -171,6 +171,7 @@ public class FullBackupImporter extends FullBackupBase {
try {
Conversions.intToByteArray(iv, 0, counter++);
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(cipherKey, "AES"), new IvParameterSpec(iv));
mac.update(iv);
byte[] buffer = new byte[8192];