27 #ifndef __DESFIRE_UTILS_H__ 28 #define __DESFIRE_UTILS_H__ 32 #include "DESFireFirmwareSettings.h" 34 #define UnsignedTypeToUINT(typeValue) \ 36 #define ExtractLSBLE(ui) \ 37 ((BYTE) (((UnsignedTypeToUINT(ui) & 0xff000000) >> 24) & 0x000000ff)) 38 #define ExtractLSBBE(ui) \ 39 ((BYTE) (UnsignedTypeToUINT(ui) & 0x000000ff)) 41 void RotateArrayRight(BYTE *srcBuf, BYTE *destBuf, SIZET bufSize);
42 void RotateArrayLeft(BYTE *srcBuf, BYTE *destBuf, SIZET bufSize);
43 void ConcatByteArrays(BYTE *arrA, SIZET arrASize, BYTE *arrB, SIZET arrBSize, BYTE *destArr);
45 void Int32ToByteBuffer(uint8_t *byteBuffer, int32_t int32Value);
46 void Int24ToByteBuffer(uint8_t *byteBuffer, uint32_t int24Value);
47 int32_t Int32FromByteBuffer(uint8_t *byteBuffer);
49 SIZET RoundBlockSize(SIZET byteSize, SIZET blockSize);
52 uint16_t DesfireAddParityBits(uint8_t *Buffer, uint16_t bits);
53 uint16_t DesfireRemoveParityBits(uint8_t *Buffer, uint16_t BitCount);
54 bool DesfireCheckParityBits(uint8_t *Buffer, uint16_t BitCount);