mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
make style
This commit is contained in:
parent
0d9223a547
commit
0373696662
483 changed files with 56514 additions and 52451 deletions
|
@ -3,9 +3,10 @@
|
|||
#define htole32(x) (x)
|
||||
#define CRC32_PRESET 0xFFFFFFFF
|
||||
|
||||
static void crc32_byte (uint32_t *crc, const uint8_t value);
|
||||
static void crc32_byte(uint32_t *crc, const uint8_t value);
|
||||
|
||||
static void crc32_byte (uint32_t *crc, const uint8_t value) {
|
||||
static void crc32_byte(uint32_t *crc, const uint8_t value)
|
||||
{
|
||||
/* x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 */
|
||||
const uint32_t poly = 0xEDB88320;
|
||||
|
||||
|
@ -18,15 +19,17 @@ static void crc32_byte (uint32_t *crc, const uint8_t value) {
|
|||
}
|
||||
}
|
||||
|
||||
void crc32_ex (const uint8_t *data, const size_t len, uint8_t *crc) {
|
||||
void crc32_ex(const uint8_t *data, const size_t len, uint8_t *crc)
|
||||
{
|
||||
uint32_t desfire_crc = CRC32_PRESET;
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
crc32_byte (&desfire_crc, data[i]);
|
||||
crc32_byte(&desfire_crc, data[i]);
|
||||
}
|
||||
|
||||
*((uint32_t *)(crc)) = htole32 (desfire_crc);
|
||||
*((uint32_t *)(crc)) = htole32(desfire_crc);
|
||||
}
|
||||
|
||||
void crc32_append (uint8_t *data, const size_t len) {
|
||||
crc32_ex (data, len, data + len);
|
||||
void crc32_append(uint8_t *data, const size_t len)
|
||||
{
|
||||
crc32_ex(data, len, data + len);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue