mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
add: reflect48
This commit is contained in:
parent
f4b01f69a6
commit
eda204bf87
2 changed files with 8 additions and 0 deletions
|
@ -144,6 +144,13 @@ uint32_t reflect32(uint32_t b) {
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t reflect48(uint64_t v) {
|
||||||
|
uint64_t vhi = reflect16(v >> 32);
|
||||||
|
uint64_t vlo = reflect32(v);
|
||||||
|
v = (vlo << 32) | (vhi & 0xFFFF);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t reflect64(uint64_t b) {
|
uint64_t reflect64(uint64_t b) {
|
||||||
// https://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable
|
// https://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable
|
||||||
uint64_t v = b; // 64-bit word to reverse bit order
|
uint64_t v = b; // 64-bit word to reverse bit order
|
||||||
|
|
|
@ -74,6 +74,7 @@ uint32_t reflect(uint32_t v, int b); // used in crc.c ...
|
||||||
uint8_t reflect8(uint8_t b); // dedicated 8bit reversal
|
uint8_t reflect8(uint8_t b); // dedicated 8bit reversal
|
||||||
uint16_t reflect16(uint16_t b); // dedicated 16bit reversal
|
uint16_t reflect16(uint16_t b); // dedicated 16bit reversal
|
||||||
uint32_t reflect32(uint32_t b); // dedicated 32bit reversal
|
uint32_t reflect32(uint32_t b); // dedicated 32bit reversal
|
||||||
|
uint64_t reflect48(uint64_t b); // dedicated 48bit reversal
|
||||||
uint64_t reflect64(uint64_t b); // dedicated 64bit reversal
|
uint64_t reflect64(uint64_t b); // dedicated 64bit reversal
|
||||||
|
|
||||||
void num_to_bytes(uint64_t n, size_t len, uint8_t *dest);
|
void num_to_bytes(uint64_t n, size_t len, uint8_t *dest);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue