mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
chg: adjusted the input parameters for crc16 implementations.
This commit is contained in:
parent
1f5477491f
commit
205e4b2300
8 changed files with 206 additions and 61 deletions
|
@ -729,15 +729,6 @@ void rol(uint8_t *data, const size_t len){
|
|||
data[len-1] = first;
|
||||
}
|
||||
|
||||
// Swap bit order on a uint32_t value. Can be limited by 'b' just use say 8 bits reversal
|
||||
// note: function clears the rest of the bits.
|
||||
uint32_t SwapBits(uint32_t v, int b) {
|
||||
uint32_t newvalue = 0;
|
||||
for(int i = 0; i < b; i++) {
|
||||
newvalue ^= ((v >> i) & 1) << (b - 1 - i);
|
||||
}
|
||||
return newvalue;
|
||||
}
|
||||
uint8_t reflect8(uint8_t b) {
|
||||
return ((b * 0x80200802ULL) & 0x0884422110ULL) * 0x0101010101ULL >> 32;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue