Skip to content

Commit

Permalink
trival
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu- committed Sep 18, 2017
1 parent dcc722f commit 378449e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/aes_faster_c/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ void AES_CBC_encrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
aes_init( &ctx);
done=1;
}

char tmp_iv[16];
if(key!=0) aes_setkey_enc(&ctx,key,AES_KEYSIZE);

memcpy(tmp_iv,iv,16);
aes_crypt_cbc( &ctx, AES_ENCRYPT, length, (unsigned char* )tmp_iv, (const unsigned char*)input,(unsigned char*) output );
return ;
Expand All @@ -47,6 +47,7 @@ void AES_CBC_decrypt_buffer(uint8_t* output, uint8_t* input, uint32_t length, co
aes_init( &ctx);
done=1;
}

char tmp_iv[16];
if(key!=0) aes_setkey_dec(&ctx,key,AES_KEYSIZE);
memcpy(tmp_iv,iv,16);
Expand Down

0 comments on commit 378449e

Please sign in to comment.