remove unneeded tmp from plain DES cbc decrypt

This commit is contained in:
toddouska
2015-09-23 11:01:22 -07:00
parent 207859cde8
commit 31439e2baa

View File

@ -1385,16 +1385,12 @@ int wc_Des_CbcEncrypt(Des* des, byte* out, const byte* in, word32 sz)
int wc_Des_CbcDecrypt(Des* des, byte* out, const byte* in, word32 sz)
{
word32 blocks = sz / DES_BLOCK_SIZE;
byte hold[DES_BLOCK_SIZE];
while (blocks--) {
XMEMCPY(des->tmp, in, DES_BLOCK_SIZE);
DesProcessBlock(des, (byte*)des->tmp, out);
xorbuf(out, (byte*)des->reg, DES_BLOCK_SIZE);
XMEMCPY(hold, des->reg, DES_BLOCK_SIZE);
XMEMCPY(des->reg, des->tmp, DES_BLOCK_SIZE);
XMEMCPY(des->tmp, hold, DES_BLOCK_SIZE);
out += DES_BLOCK_SIZE;
in += DES_BLOCK_SIZE;