Reply To: I cant change key

Forum MIFARE SmartCard IC`s MIFARE DESFire I cant change key Reply To: I cant change key

Re: I cant change key

12. January 2016 at 9:39
// this function calculates a CRC16 over a unsigned char Array with, LSB first
// @Param1 (DataBuf): An Array, which contains the Data for Calculation
// @Param2 (SizeOfDataBuf): length of the Data Buffer (DataBuf)
// @Param3 (Polynom): Value of the Generatorpolynom, 0x8408 is recommended
// @Param4 (Initial_Value): load value for CRC16, 0xFFFF is recommended for
// host to reader communication
// return: calculated CRC16
uint16_t GetCrc( uint8_t *DataBuf,uint8_t SizeOfDataBuf,uint16_t Polynom,uint16_t Initial_Value)

uint16_t Crc16;
uint8_t Byte_Counter, Bit_Counter;
Crc16 = Initial_Value;
for (Byte_Counter=0; Byte_Counter < SizeOfDataBuf; Byte_Counter++)
for (Bit_Counter=0; Bit_Counter>=1;
return (Crc16);
+ 0  |  - 0