fix tea_ecb_encrypt()

This fixes #553
This commit is contained in:
Steffen Jaeckel 2020-11-09 08:50:11 +01:00 committed by Jamie Reece Wilson
parent b48a724ba4
commit 49d6722fc3

View File

@ -68,7 +68,7 @@ int tea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_
LOAD32H(y, &pt[0]);
LOAD32H(z, &pt[4]);
for (r = 0; r < 32; r += 4) {
for (r = 0; r < 32; r++) {
sum += delta;
y += ((z<<4) + skey->tea.k[0]) ^ (z + sum) ^ ((z>>5) + skey->tea.k[1]);
z += ((y<<4) + skey->tea.k[2]) ^ (y + sum) ^ ((y>>5) + skey->tea.k[3]);