Revert "Merge branch 'master' into hf_mf_sim"

This reverts commit cbea5d9d02, reversing
changes made to b66152feb2.
This commit is contained in:
vratiskol 2019-03-15 21:45:00 +01:00
commit cfe2b2797e
161 changed files with 1465 additions and 2004 deletions

View file

@ -21,4 +21,4 @@ typedef struct bucket_info {
void bucket_sort_intersect(uint32_t *const estart, uint32_t *const estop,
uint32_t *const ostart, uint32_t *const ostop,
bucket_info_t *bucket_info, bucket_array_t bucket);
#endif
#endif

View file

@ -61,4 +61,4 @@ uint8_t cmd_send(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void
#endif
return sendlen;
}
}

View file

@ -123,4 +123,4 @@ uint32_t CRC8Legic(uint8_t *buff, size_t size) {
for (int i = 0; i < size; ++i)
crc_update2(&crc, buff[i], 8);
return reflect8(crc_finish(&crc));
}
}

View file

@ -67,4 +67,4 @@ void reset_table(void);
void generate_table(uint16_t polynomial, bool refin);
uint16_t crc16_fast(uint8_t const *d, size_t n, uint16_t initval, bool refin, bool refout);
#endif
#endif

View file

@ -29,4 +29,4 @@ void crc32_ex(const uint8_t *data, const size_t len, uint8_t *crc) {
void crc32_append(uint8_t *data, const size_t len) {
crc32_ex(data, len, data + len);
}
}

View file

@ -80,4 +80,4 @@ void crc64(const uint8_t *data, const size_t len, uint64_t *crc) {
}
}
//suint8_t x = (c & 0xFF00000000000000 ) >> 56;
//suint8_t x = (c & 0xFF00000000000000 ) >> 56;

View file

@ -48,4 +48,4 @@ void SmartCardUpgrade(uint64_t arg0);
void SmartCardSetBaud(uint64_t arg0);
void SmartCardSetClock(uint64_t arg0);
void I2C_print_status(void);
#endif
#endif

View file

@ -14,13 +14,12 @@
// return: ptr to string
char *Iso15693sprintUID(char *target, uint8_t *uid) {
static char tempbuf[3 * 8 + 1] = {0};
static char tempbuf[2 * 8 + 1] = {0};
if (target == NULL)
target = tempbuf;
sprintf(target, "%02X %02X %02X %02X %02X %02X %02X %02X",
uid[7], uid[6], uid[5], uid[4],
uid[3], uid[2], uid[1], uid[0]
);
return target;
}
}

View file

@ -123,4 +123,4 @@ static const int Iso15693FrameEOF[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
#endif
#endif

View file

@ -62,4 +62,4 @@ uint32_t legic_prng_get_bits(uint8_t len) {
legic_prng_forward(1);
}
return a;
}
}

View file

@ -1357,7 +1357,6 @@ int BiphaseRawDecode(uint8_t *bits, size_t *size, int *offset, int invert) {
//by marshmellow
//take 10 and 01 and manchester decode
//run through 2 times and take least errCnt
// "7" indicates 00 or 11 wrong bit
int manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos) {
// sanity check
@ -1369,7 +1368,7 @@ int manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos)
//find correct start position [alignment]
for (k = 0; k < 2; ++k) {
for (i = k; i < *size - 1; i += 2) {
for (i = k; i < *size - 3; i += 2) {
if (bits[i] == bits[i + 1])
errCnt++;
}
@ -1381,7 +1380,7 @@ int manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos)
}
*alignPos = bestRun;
//decode
for (i = bestRun; i < *size - 1; i += 2) {
for (i = bestRun; i < *size - 3; i += 2) {
if (bits[i] == 1 && (bits[i + 1] == 0)) {
bits[bitnum++] = invert;
} else if ((bits[i] == 0) && bits[i + 1] == 1) {

View file

@ -22,7 +22,7 @@
#include "util.h" // for ARRAYLEN
//might not be high enough for noisy environments
#define NOISE_AMPLITUDE_THRESHOLD 15
#define NOISE_AMPLITUDE_THRESHOLD 10
//ignore buffer with less than x samples
#define SIGNAL_MIN_SAMPLES 100
//ignore first x samples of the buffer

View file

@ -21,4 +21,4 @@ void burtle_init_mod(prng_ctx *x, uint32_t seed);
void burtle_init(prng_ctx *x, uint32_t seed);
uint32_t GetSimplePrng(uint32_t seed);
#endif /* __PRNG_H */
#endif /* __PRNG_H */

View file

@ -277,7 +277,6 @@ ISO 7816-4 Basic interindustry commands. For command APDU's.
#define ISO_15693 7
#define FELICA 8
#define PROTO_MIFARE 9
#define PROTO_HITAG 10
//-- Picopass fuses
#define FUSE_FPERS 0x80

View file

@ -96,4 +96,4 @@ uint64_t *radixSort(uint64_t *array, uint32_t size) {
}
free(cpy);
return array;
}
}

View file

@ -20,4 +20,4 @@ typedef union {
} rscounts_t;
uint64_t *radixSort(uint64_t *array, uint32_t size);
#endif // RADIXSORT_H__
#endif // RADIXSORT_H__

View file

@ -18,4 +18,4 @@
void fast_prand();
void fast_prandEx(uint32_t seed);
uint32_t prand();
#endif
#endif

View file

@ -15,4 +15,4 @@
#include <stddef.h>
void tea_encrypt(uint8_t *v, uint8_t *key);
void tea_decrypt(uint8_t *v, uint8_t *key);
#endif /* __TEA_H */
#endif /* __TEA_H */

View file

@ -140,4 +140,4 @@ void usart_init(void) {
// re-enable receiver / transmitter
pUS1->US_CR = (AT91C_US_RXEN | AT91C_US_TXEN);
}
}

View file

@ -949,4 +949,4 @@ void AT91F_CDC_Enumerate() {
AT91F_USB_SendStall(pUdp);
break;
}
}
}

View file

@ -236,4 +236,4 @@ void num_to_wiegand_bits(uint64_t oem, uint64_t fc, uint64_t cn, uint8_t *dest,
default:
break;
}
}
}