File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1241,9 +1241,9 @@ countKeys *uniqsort(uint64_t *possibleKeys, uint32_t size)
1241
1241
// Return 1 if the nonce is invalid else return 0
1242
1242
int valid_nonce (uint32_t Nt , uint32_t NtEnc , uint32_t Ks1 , uint8_t * parity )
1243
1243
{
1244
- return ((odd_parity ((Nt >> 24 ) & 0xFF ) == ((parity [0 ]) ^ odd_parity ((NtEnc >> 24 ) & 0xFF ) ^ BIT (Ks1 , 16 ))) & \
1245
- (odd_parity ((Nt >> 16 ) & 0xFF ) == ((parity [1 ]) ^ odd_parity ((NtEnc >> 16 ) & 0xFF ) ^ BIT (Ks1 , 8 ))) & \
1246
- (odd_parity ((Nt >> 8 ) & 0xFF ) == ((parity [2 ]) ^ odd_parity ((NtEnc >> 8 ) & 0xFF ) ^ BIT (Ks1 , 0 )))) ? 1 : 0 ;
1244
+ return ((oddparity ((Nt >> 24 ) & 0xFF ) == ((parity [0 ]) ^ oddparity ((NtEnc >> 24 ) & 0xFF ) ^ BIT (Ks1 , 16 ))) &&
1245
+ (oddparity ((Nt >> 16 ) & 0xFF ) == ((parity [1 ]) ^ oddparity ((NtEnc >> 16 ) & 0xFF ) ^ BIT (Ks1 , 8 ))) &&
1246
+ (oddparity ((Nt >> 8 ) & 0xFF ) == ((parity [2 ]) ^ oddparity ((NtEnc >> 8 ) & 0xFF ) ^ BIT (Ks1 , 0 )))) ? 1 : 0 ;
1247
1247
}
1248
1248
1249
1249
void num_to_bytes (uint64_t n , uint32_t len , uint8_t * dest )
Original file line number Diff line number Diff line change 35
35
// Number of sets with 32b keys
36
36
#define DEFAULT_SETS_NR 5
37
37
38
- #define odd_parity (i ) (( (i) ^ (i)>>1 ^ (i)>>2 ^ (i)>>3 ^ (i)>>4 ^ (i)>>5 ^ (i)>>6 ^ (i)>>7 ^ 1) & 0x01)
39
-
40
38
typedef struct {
41
39
uint8_t KeyA [6 ];
42
40
uint8_t KeyB [6 ];
You can’t perform that action at this time.
0 commit comments