projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ADD: added @azcid 's bitsliced BF solver for @piwi 's hardnested command. Awsume...
[proxmark3-svn]
/
common
/
crc.c
diff --git
a/common/crc.c
b/common/crc.c
index 21019da9c0b97891d8717779e0bf7d5538924f7b..6c2f699430e0e6ed78d774315ce423f473bf10c7 100644
(file)
--- a/
common/crc.c
+++ b/
common/crc.c
@@
-7,7
+7,6
@@
//-----------------------------------------------------------------------------
#include "crc.h"
#include "util.h"
//-----------------------------------------------------------------------------
#include "crc.h"
#include "util.h"
-#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdint.h>
#include <stddef.h>
@@
-44,8
+43,7
@@
uint32_t crc_finish(crc_t *crc)
}
//credits to iceman
}
//credits to iceman
-uint32_t CRC8Maxim(uint8_t *buff, size_t size)
-{
+uint32_t CRC8Maxim(uint8_t *buff, size_t size) {
crc_t crc;
crc_init(&crc, 9, 0x8c, 0x00, 0x00);
crc_clear(&crc);
crc_t crc;
crc_init(&crc, 9, 0x8c, 0x00, 0x00);
crc_clear(&crc);
@@
-56,6
+54,7
@@
uint32_t CRC8Maxim(uint8_t *buff, size_t size)
return crc_finish(&crc);
}
return crc_finish(&crc);
}
+//credits to iceman
uint32_t CRC8Legic(uint8_t *buff, size_t size) {
// Poly 0x63, reversed poly 0xC6, Init 0x55, Final 0x00
uint32_t CRC8Legic(uint8_t *buff, size_t size) {
// Poly 0x63, reversed poly 0xC6, Init 0x55, Final 0x00
@@
-68,10
+67,4
@@
uint32_t CRC8Legic(uint8_t *buff, size_t size) {
return SwapBits(crc_finish(&crc), 8);
}
return SwapBits(crc_finish(&crc), 8);
}
-uint32_t SwapBits(uint32_t value, int nrbits) {
- uint32_t newvalue = 0;
- for(int i = 0; i < nrbits; i++) {
- newvalue ^= ((value >> i) & 1) << (nrbits - 1 - i);
- }
- return newvalue;
-}
+
Impressum
,
Datenschutz