]> Chaos Git - corbenik/corbenik.git/commitdiff
Checkpoint, to the other branches
authorchaoskagami <chaos.kagami@gmail.com>
Sat, 30 Jul 2016 03:03:21 +0000 (23:03 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Sat, 30 Jul 2016 03:03:21 +0000 (23:03 -0400)
source/firm/decryptor.c

index 367e8fcb0b531ad20f857f832b7d2f8a5f3c29fe..9a45018c121f9907a2e712f78978144cfe86deb7 100644 (file)
@@ -46,9 +46,9 @@ cbc_decrypt(void *inbuf, void *outbuf, size_t size, uint32_t mode, uint8_t *iv)
 
         size_t current_blocks = blocks > 0xFFFF ? 0xFFFF : blocks;
 
-        aes_decrypt(in, out, current_blocks, mode);
+               memcpy(iv, &in[(current_blocks - 1) * AES_BLOCK_SIZE], AES_BLOCK_SIZE);
 
-        memcpy(iv, out + (current_blocks - 1) * AES_BLOCK_SIZE, AES_BLOCK_SIZE);
+        aes_decrypt(in, out, current_blocks, mode);
 
         blocks -= current_blocks;
         in  += AES_BLOCK_SIZE * current_blocks;