summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkokke <spam@rowdy.dk>2017-11-10 20:19:02 +0100
committerGitHub <noreply@github.com>2017-11-10 20:19:02 +0100
commit84468b291bb7c258b40870dd999f75cbff00aa50 (patch)
tree1af5e76c9ed1b3247bc2f8f7afe07c2d7d03cc36
parentUpdate aes.c (diff)
downloadtiny-AES-c-84468b291bb7c258b40870dd999f75cbff00aa50.tar
tiny-AES-c-84468b291bb7c258b40870dd999f75cbff00aa50.tar.gz
tiny-AES-c-84468b291bb7c258b40870dd999f75cbff00aa50.tar.bz2
tiny-AES-c-84468b291bb7c258b40870dd999f75cbff00aa50.tar.lz
tiny-AES-c-84468b291bb7c258b40870dd999f75cbff00aa50.tar.xz
tiny-AES-c-84468b291bb7c258b40870dd999f75cbff00aa50.tar.zst
tiny-AES-c-84468b291bb7c258b40870dd999f75cbff00aa50.zip
-rw-r--r--aes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/aes.c b/aes.c
index 00575dc..0ff8367 100644
--- a/aes.c
+++ b/aes.c
@@ -550,6 +550,8 @@ void AES_CBC_encrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
if (extra)
{
memcpy(output, input, extra);
+ memset((output + extra), 0, (BLOCKLEN - extra));
+ XorWithIv(output);
state = (state_t*)output;
Cipher();
}