DES_set_odd_parity to MLB

This commit is contained in:
Takashi Kojo
2017-07-17 08:49:23 +09:00
committed by Jacob Barthelmeh
parent a3ad8c5bae
commit c80cadb25f
2 changed files with 4 additions and 3 deletions

View File

@@ -20392,7 +20392,7 @@ void wolfSSL_DES_set_odd_parity(WOLFSSL_DES_cblock* myDes)
for (i = 0; i < sz; i++) {
unsigned char c = *((unsigned char*)myDes + i);
if (((c & 0x01) ^
if ((
((c >> 1) & 0x01) ^
((c >> 2) & 0x01) ^
((c >> 3) & 0x01) ^
@@ -20401,7 +20401,7 @@ void wolfSSL_DES_set_odd_parity(WOLFSSL_DES_cblock* myDes)
((c >> 6) & 0x01) ^
((c >> 7) & 0x01)) != 1) {
WOLFSSL_MSG("Setting odd parity bit");
*((unsigned char*)myDes + i) = *((unsigned char*)myDes + i) | 0x80;
*((unsigned char*)myDes + i) = *((unsigned char*)myDes + i) | 0x01;
}
}
}