diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2016-02-06 13:57:56 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-02-08 06:01:05 +0000 |
commit | 40331511ed9c117703c3097f23e3a2f17b17e993 (patch) | |
tree | 8cf742e5d33f1c747f6476698396871c3d2d7bb6 /wsutil/crc16.c | |
parent | 0fbc8f80dae3fa7f47d121b25655ac86268681b8 (diff) | |
download | wireshark-40331511ed9c117703c3097f23e3a2f17b17e993.tar.gz |
add functions to calculate the CRC of an ISO14443-A message
Change-Id: I1ccd9885746a6044f298d7d531a9bc009a70288e
Reviewed-on: https://code.wireshark.org/review/13802
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil/crc16.c')
-rw-r--r-- | wsutil/crc16.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/wsutil/crc16.c b/wsutil/crc16.c index 8febfa1c66..2ff576c200 100644 --- a/wsutil/crc16.c +++ b/wsutil/crc16.c @@ -346,6 +346,14 @@ guint16 crc16_ccitt_seed(const guint8 *buf, guint len, guint16 seed) ^ crc16_ccitt_xorout; } +/* ISO14443-3, section 6.2.4: For ISO14443-A, the polynomial 0x1021 is + used, the initial register value shall be 0x6363, the final register + value is not XORed with anything. */ +guint16 crc16_iso14443a(const guint8 *buf, guint len) +{ + return crc16_reflected(buf,len, 0x6363 ,crc16_ccitt_table_reverse); +} + guint16 crc16_0x5935(const guint8 *buf, guint32 len, guint16 seed) { return crc16_unreflected(buf, len, seed, crc16_precompiled_5935); |