File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 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)
12411241// Return 1 if the nonce is invalid else return 0
12421242int valid_nonce (uint32_t Nt , uint32_t NtEnc , uint32_t Ks1 , uint8_t * parity )
12431243{
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 ;
12471247}
12481248
12491249void num_to_bytes (uint64_t n , uint32_t len , uint8_t * dest )
Original file line number Diff line number Diff line change 3535// Number of sets with 32b keys
3636#define DEFAULT_SETS_NR 5
3737
38- #define odd_parity (i ) (( (i) ^ (i)>>1 ^ (i)>>2 ^ (i)>>3 ^ (i)>>4 ^ (i)>>5 ^ (i)>>6 ^ (i)>>7 ^ 1) & 0x01)
39-
4038typedef struct {
4139 uint8_t KeyA [6 ];
4240 uint8_t KeyB [6 ];
You can’t perform that action at this time.
0 commit comments