Update aes.c

This commit is contained in:
kokke 2017-11-10 20:19:02 +01:00 committed by GitHub
parent 1cd676c262
commit 84468b291b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

2
aes.c
View File

@ -550,6 +550,8 @@ void AES_CBC_encrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
if (extra) if (extra)
{ {
memcpy(output, input, extra); memcpy(output, input, extra);
memset((output + extra), 0, (BLOCKLEN - extra));
XorWithIv(output);
state = (state_t*)output; state = (state_t*)output;
Cipher(); Cipher();
} }