mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
use partiy.h and textual
This commit is contained in:
parent
5fd951f7d4
commit
e5fc1d83b2
2 changed files with 32 additions and 24 deletions
|
@ -23,6 +23,24 @@ static inline uint8_t evenparity8(const uint8_t x) {
|
|||
return !OddByteParity[x];
|
||||
}
|
||||
|
||||
static inline uint8_t evenparity16(uint16_t x) {
|
||||
#if !defined __GNUC__
|
||||
x ^= x >> 8;
|
||||
return evenparity8(x);
|
||||
#else
|
||||
return (__builtin_parity(x) & 0xFF);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint8_t oddparity16(uint16_t x) {
|
||||
#if !defined __GNUC__
|
||||
x ^= x >> 8;
|
||||
return oddparity8(x);
|
||||
#else
|
||||
return !__builtin_parity(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint8_t evenparity32(uint32_t x) {
|
||||
#if !defined __GNUC__
|
||||
x ^= x >> 16;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue