Skip to content

Commit

Permalink
Working AES128 auth ; Nearly working ISO auth (still debugging) -- St…
Browse files Browse the repository at this point in the history
…ashing copy for reference
  • Loading branch information
maxieds committed Feb 3, 2022
1 parent 7176259 commit b451e12
Show file tree
Hide file tree
Showing 32 changed files with 562 additions and 327 deletions.
7 changes: 7 additions & 0 deletions Doc/DESFireSupportReadme.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ Syntax:
DF_TESTMODE?
DF_TESTMODE=<0|1|TRUE|FALSE|OFF|ON>
```
#### DF_COMM_MODE

Syntax:
```bash
DF_COMM_MODE?
DF_COMM_MODE=<Plaintext|Plaintext:MAC|Enciphered:3K3DES|Enciphered:AES128>
```

### Links to public datasheets and online specs

Expand Down
9 changes: 8 additions & 1 deletion Firmware/Chameleon-Mini/Application/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ INLINE void ApplicationInit(void) {
ActiveConfiguration.ApplicationInitFunc();
}

INLINE void ApplicationInitRunOnce(void) {
if (ActiveConfiguration.ApplicationInitRunOnceFunc != NULL) {
ActiveConfiguration.ApplicationInitRunOnceFunc();
} else {
ActiveConfiguration.ApplicationInitFunc();
}
}

INLINE void ApplicationTask(void) {
ActiveConfiguration.ApplicationTaskFunc();
}
Expand All @@ -43,7 +51,6 @@ INLINE uint16_t ApplicationProcess(uint8_t *ByteBuffer, uint16_t ByteCount) {

INLINE void ApplicationReset(void) {
ActiveConfiguration.ApplicationResetFunc();
//LogEntry(LOG_INFO_RESET_APP, NULL, 0);
}

INLINE void ApplicationGetUid(ConfigurationUidType Uid) {
Expand Down
9 changes: 9 additions & 0 deletions Firmware/Chameleon-Mini/Application/CryptoMAC.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@ This notice must be retained at the top of all source files where indicated.
#include "CryptoTDEA.h"
#include "CryptoAES128.h"

/* MAC and CMAC source code based on github/andrade/nfcjlib */

#define CRYPTO_CMAC_RB64 (0x1B)
#define CRYPTO_CMAC_RB128 ((uint8_t) 0x87)

void getCMACSubK1(uint8_t *bufferL, uint16_t blockSize, uint8_t polyByte, uint8_t *bufferOut);
void getCMACSubK2(uint8_t *bufferK1, uint16_t blockSize, uint8_t polyByte, uint8_t *bufferOut);

bool computeBufferCMACFull(uint8_t *keyData, uint8_t *bufferK1, uint8_t *bufferK2, uint8_t *bufferIV, uint16_t blockSize, uint16_t cryptoType);
bool computeBufferCMAC(uint16_t cryptoType, uint8_t *keyData, uint8_t *bufferData, uint8_t *aesIV);

bool computeMac(uint8_t *bufferData, uint16_t dataLength, uint8_t *keyData, uint16_t cryptoKeyType);

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ This notice must be retained at the top of all source files where indicated.

void SynchronizeAppDir(void) {
WriteBlockBytes(&AppDir, DESFIRE_APP_DIR_BLOCK_ID, sizeof(DESFireAppDirType));
//SIZET appCacheSelectedBlockId = AppDir.AppCacheStructBlockOffset[SelectedApp.Slot];
//WriteBlockBytes(&SelectedApp, appCacheSelectedBlockId, sizeof(SelectedAppCacheType));
}

BYTE PMKConfigurationChangeable(void) {
Expand Down Expand Up @@ -210,6 +208,8 @@ void SetAppProperty(DesfireCardLayout propId, BYTE AppSlot, SIZET Value) {

bool KeyIdValid(uint8_t AppSlot, uint8_t KeyId) {
if (KeyId >= DESFIRE_MAX_KEYS || KeyId >= ReadMaxKeyCount(AppSlot)) {
const char *debugMsg = PSTR("INVKEY-KeyId(%02x)-RdMax(%02x)");
DEBUG_PRINT_P(debugMsg, KeyId, ReadMaxKeyCount(AppSlot));
return false;
}
return true;
Expand Down Expand Up @@ -308,6 +308,16 @@ void ReadAppKey(uint8_t AppSlot, uint8_t KeyId, uint8_t *Key, SIZET KeySize) {
SIZET keyStorageArray[DESFIRE_MAX_KEYS];
ReadBlockBytes(keyStorageArray, keyStorageArrayBlockId, 2 * DESFIRE_MAX_KEYS);
ReadBlockBytes(Key, keyStorageArray[KeyId], KeySize);
/*if (KeySize > DESFIRE_EEPROM_BLOCK_SIZE) {
ReadBlockBytes(Key, keyStorageArray[KeyId], DESFIRE_EEPROM_BLOCK_SIZE);
uint8_t fullBlock[DESFIRE_EEPROM_BLOCK_SIZE];
ReadBlockBytes(fullBlock, keyStorageArray[KeyId] + 1, DESFIRE_EEPROM_BLOCK_SIZE);
memcpy(Key + DESFIRE_EEPROM_BLOCK_SIZE, fullBlock, KeySize - DESFIRE_EEPROM_BLOCK_SIZE);
} else {
uint8_t fullBlock[DESFIRE_EEPROM_BLOCK_SIZE];
ReadBlockBytes(fullBlock, keyStorageArray[KeyId], DESFIRE_EEPROM_BLOCK_SIZE);
memcpy(Key, fullBlock, KeySize);
}*/
}

void WriteAppKey(uint8_t AppSlot, uint8_t KeyId, const uint8_t *Key, SIZET KeySize) {
Expand All @@ -319,6 +329,7 @@ void WriteAppKey(uint8_t AppSlot, uint8_t KeyId, const uint8_t *Key, SIZET KeySi
SIZET keyStorageArrayBlockId = ReadKeyStorageAddress(AppSlot);
SIZET keyStorageArray[DESFIRE_MAX_KEYS];
ReadBlockBytes(keyStorageArray, keyStorageArrayBlockId, 2 * DESFIRE_MAX_KEYS);
// TODO:
WriteBlockBytes(Key, keyStorageArray[KeyId], KeySize);
}

Expand Down Expand Up @@ -556,8 +567,7 @@ uint16_t CreateApp(const DESFireAidType Aid, uint8_t KeyCount, uint8_t KeySettin
bool initMasterApp = false;

/* Verify this AID has not been allocated yet */
if ((Aid[0] == 0x00) && (Aid[1] == 0x00) && (Aid[2] == 0x00) &&
AppDir.FirstFreeSlot == 0) {
if ((Aid[0] == 0x00) && (Aid[1] == 0x00) && (Aid[2] == 0x00) && AppDir.FirstFreeSlot == 0) {
Slot = 0;
initMasterApp = true;
} else if ((Aid[0] == 0x00) && (Aid[1] == 0x00) && (Aid[2] == 0x00)) {
Expand All @@ -584,6 +594,8 @@ uint16_t CreateApp(const DESFireAidType Aid, uint8_t KeyCount, uint8_t KeySettin
/* Allocate storage for the application structure itself */
AppDir.AppCacheStructBlockOffset[Slot] = AllocateBlocks(SELECTED_APP_CACHE_TYPE_BLOCK_SIZE);
if (AppDir.AppCacheStructBlockOffset[Slot] == 0) {
const char *debugMsg = PSTR("X - alloc blks, slot = %d");
DEBUG_PRINT_P(debugMsg, Slot);
return STATUS_OUT_OF_EEPROM_ERROR;
}
/* Allocate storage for the application components */
Expand Down Expand Up @@ -639,9 +651,9 @@ uint16_t CreateApp(const DESFireAidType Aid, uint8_t KeyCount, uint8_t KeySettin
if (appCacheData.KeyTypesArray == 0) {
return STATUS_OUT_OF_EEPROM_ERROR;
} else {
BYTE keyTypesData[DESFIRE_MAX_KEYS];
memset(keyTypesData, 0x00, DESFIRE_MAX_KEYS);
WriteBlockBytes(keyTypesData, appCacheData.KeyTypesArray, DESFIRE_MAX_KEYS);
BYTE keyTypesData[APP_CACHE_KEY_TYPES_ARRAY_BLOCK_SIZE * DESFIRE_EEPROM_BLOCK_SIZE];
memset(keyTypesData, 0x00, APP_CACHE_KEY_TYPES_ARRAY_BLOCK_SIZE * DESFIRE_EEPROM_BLOCK_SIZE);
WriteBlockBytes(keyTypesData, appCacheData.KeyTypesArray, APP_CACHE_KEY_TYPES_ARRAY_BLOCK_SIZE * DESFIRE_EEPROM_BLOCK_SIZE);
}
appCacheData.FilesAddress = AllocateBlocks(APP_CACHE_FILE_BLOCKIDS_ARRAY_BLOCK_SIZE);
if (appCacheData.FilesAddress == 0) {
Expand All @@ -664,8 +676,10 @@ uint16_t CreateApp(const DESFireAidType Aid, uint8_t KeyCount, uint8_t KeySettin
}
BYTE cryptoBlankKeyData[CRYPTO_MAX_KEY_SIZE];
memset(cryptoBlankKeyData, 0x00, CRYPTO_MAX_KEY_SIZE);
WriteBlockBytes(cryptoBlankKeyData, keyAddresses[0], CRYPTO_MAX_KEY_SIZE);
WriteBlockBytes(keyAddresses, appCacheData.KeyAddress, sizeof(SIZET) * DESFIRE_MAX_KEYS);
//WriteBlockBytes(cryptoBlankKeyData, keyAddresses[0], DESFIRE_EEPROM_BLOCK_SIZE);
//WriteBlockBytes(cryptoBlankKeyData, keyAddresses[0] + 1, CRYPTO_MAX_KEY_SIZE - DESFIRE_EEPROM_BLOCK_SIZE);
WriteBlockBytes(cryptoBlankKeyData, keyAddresses[0], CRYPTO_MAX_KEY_SIZE);
WriteBlockBytes(keyAddresses, appCacheData.KeyAddress, sizeof(SIZET) * DESFIRE_MAX_KEYS);
}
SIZET appCacheDataBlockId = AppDir.AppCacheStructBlockOffset[Slot];
WriteBlockBytes(&appCacheData, appCacheDataBlockId, sizeof(SelectedAppCacheType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ This notice must be retained at the top of all source files where indicated.
#define DESFIRE_MAX_FILES_EV0 16
#define DESFIRE_MAX_FILES_EV1 32

#if defined(DESFIRE_MEMORY_LIMITED_TESTING) && !defined(DESFIRE_CUSTOM_MAX_APPS)
#define DESFIRE_MAX_APPS (6)
#if defined(MEMORY_LIMITED_TESTING) && !defined(DESFIRE_CUSTOM_MAX_APPS)
#define DESFIRE_MAX_APPS (3)
#elif defined(DESFIRE_CUSTOM_MAX_APPS)
#define DESFIRE_MAX_APPS (DESFIRE_CUSTOM_MAX_APPS)
#else
Expand All @@ -45,16 +45,16 @@ This notice must be retained at the top of all source files where indicated.

#define DESFIRE_MAX_SLOTS (DESFIRE_MAX_APPS + 1)

#if defined(DESFIRE_MEMORY_LIMITED_TESTING) && !defined(DESFIRE_CUSTOM_MAX_FILES)
#define DESFIRE_MAX_FILES (6)
#if defined(MEMORY_LIMITED_TESTING) && !defined(DESFIRE_CUSTOM_MAX_FILES)
#define DESFIRE_MAX_FILES (4)
#elif defined(DESFIRE_CUSTOM_MAX_FILES)
#define DESFIRE_MAX_FILES (DESFIRE_CUSTOM_MAX_FILES)
#else
#define DESFIRE_MAX_FILES (DESFIRE_MAX_FILES_EV1)
#endif

#if defined(DESFIRE_MEMORY_LIMITED_TESTING) && !defined(DESFIRE_CUSTOM_MAX_KEYS)
#define DESFIRE_MAX_KEYS (4)
#if defined(MEMORY_LIMITED_TESTING) && !defined(DESFIRE_CUSTOM_MAX_KEYS)
#define DESFIRE_MAX_KEYS (2)
#elif defined(DESFIRE_CUSTOM_MAX_KEYS)
#define DESFIRE_MAX_KEYS (DESFIRE_CUSTOM_MAX_KEYS)
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ CommandStatusIdType CommandDESFireFirmwareInfo(char *OutParam) {
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE,
PSTR("Chameleon-Mini DESFire enabled firmware built on %s "
"based on %s from \r\n"
"https://github.com/maxieds/ChameleonMiniFirmwareDESFireStack.\r\n"
"https://github.com/maxieds/ChameleonMini.\r\n"
"Revision: %s\r\n"),
DESFIRE_FIRMWARE_BUILD_TIMESTAMP,
DESFIRE_FIRMWARE_GIT_COMMIT_ID,
Expand Down Expand Up @@ -239,4 +239,47 @@ CommandStatusIdType CommandDESFireSetTestingMode(char *OutParam, const char *InP
return COMMAND_ERR_INVALID_USAGE_ID;
}

CommandStatusIdType CommandDESFireGetCommMode(char *OutParam) {
if (!IsDESFireConfiguration()) {
ExitOnInvalidConfigurationError(OutParam);
} else if(DesfireCommMode == DESFIRE_COMMS_PLAINTEXT) {
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("Plaintext"));
} else if(DesfireCommMode == DESFIRE_COMMS_PLAINTEXT_MAC) {
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("Plaintext/MAC"));
} else if(DesfireCommMode == DESFIRE_COMMS_CIPHERTEXT_DES) {
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("Enciphered/DES"));
} else if(DesfireCommMode == DESFIRE_COMMS_CIPHERTEXT_AES128) {
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("Enciphered/AES128"));
} else {
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("Unknown"));
}
return COMMAND_INFO_OK_WITH_TEXT_ID;
}

CommandStatusIdType CommandDESFireSetCommMode(char *OutParam, const char *InParams) {
if (!IsDESFireConfiguration()) {
ExitOnInvalidConfigurationError(OutParam);
}
char valueStr[16];
if (!sscanf_P(InParams, PSTR("%15s"), valueStr)) {
return COMMAND_ERR_INVALID_PARAM_ID;
}
valueStr[15] = '\0';
if (!strcasecmp_P(valueStr, PSTR("Plaintext"))) {
DesfireCommMode = DESFIRE_COMMS_PLAINTEXT;
return COMMAND_INFO_OK;
} else if (!strcasecmp_P(valueStr, PSTR("Plaintext:MAC"))) {
DesfireCommMode = DESFIRE_COMMS_PLAINTEXT_MAC;
return COMMAND_INFO_OK;
} else if (!strcasecmp_P(valueStr, PSTR("Enciphered:3K3DES"))) {
DesfireCommMode = DESFIRE_COMMS_CIPHERTEXT_DES;
return COMMAND_INFO_OK;
} else if (!strcasecmp_P(valueStr, PSTR("Enciphered:AES128"))) {
DesfireCommMode = DESFIRE_COMMS_CIPHERTEXT_AES128;
return COMMAND_INFO_OK;
}
snprintf_P(OutParam, TERMINAL_BUFFER_SIZE, PSTR("Options are: Plaintext|Plaintext:MAC|Enciphered:3K3DES|Enciphered:AES128"));
return COMMAND_ERR_INVALID_USAGE_ID;
}

#endif /* CONFIG_MF_DESFIRE_SUPPORT */
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ CommandStatusIdType CommandDESFireSetLoggingMode(char *OutMessage, const char *I
CommandStatusIdType CommandDESFireGetTestingMode(char *OutParam);
CommandStatusIdType CommandDESFireSetTestingMode(char *OutMessage, const char *InParams);

#define DFCOMMAND_COMM_MODE "DF_COMM_MODE"
CommandStatusIdType CommandDESFireGetCommMode(char *OutParam);
CommandStatusIdType CommandDESFireSetCommMode(char *OutMessage, const char *InParams);

#endif

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ This notice must be retained at the top of all source files where indicated.
.ExecParamFunc = NO_FUNCTION,
.SetFunc = CommandDESFireSetTestingMode,
.GetFunc = CommandDESFireGetTestingMode
}, {
.Command = DFCOMMAND_COMM_MODE,
.ExecFunc = NO_FUNCTION,
.ExecParamFunc = NO_FUNCTION,
.SetFunc = CommandDESFireSetCommMode,
.GetFunc = CommandDESFireGetCommMode
},

#endif

#endif /* CONFIG_MF_DESFIRE_SUPPORT */
40 changes: 35 additions & 5 deletions Firmware/Chameleon-Mini/Application/DESFire/DESFireCrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ This notice must be retained at the top of all source files where indicated.

CryptoKeyBufferType SessionKey = { 0 };
CryptoIVBufferType SessionIV = { 0 };
BYTE SessionIVByteSize = { 0 };
BYTE SessionIVByteSize = 0;
BYTE DesfireCommMode = DESFIRE_DEFAULT_COMMS_STANDARD;

uint16_t AESCryptoKeySizeBytes = 0;
CryptoAESConfig_t AESCryptoContext = { 0 };
DesfireAESCryptoKey AESCryptoSessionKey = { 0 };
DesfireAESCryptoKey AESCryptoIVBuffer = { 0 };

uint8_t Authenticated = 0x00;
uint8_t AuthenticatedWithKey = DESFIRE_NOT_AUTHENTICATED;
Expand Down Expand Up @@ -121,6 +120,38 @@ const char *GetCommSettingsDesc(uint8_t cryptoType) {
}
}

/* Code is adapted from @github/andrade/nfcjlib */
bool generateSessionKey(uint8_t *sessionKey, uint8_t *rndA, uint8_t *rndB, uint16_t cryptoType) {
switch(cryptoType) {
case CRYPTO_TYPE_DES:
memcpy(sessionKey, rndA, 4);
memcpy(sessionKey + 4, rndB, 4);
break;
case CRYPTO_TYPE_2KTDEA:
memcpy(sessionKey, rndA, 4);
memcpy(sessionKey + 4, rndB, 4);
memcpy(sessionKey + 8, rndA + 4, 4);
memcpy(sessionKey + 12, rndB + 4, 4);
break;
case CRYPTO_TYPE_3K3DES:
memcpy(sessionKey, rndA, 4);
memcpy(sessionKey + 4, rndB, 4);
memcpy(sessionKey + 8, rndA + 6, 4);
memcpy(sessionKey + 12, rndB + 6, 4);
memcpy(sessionKey + 16, rndA + 12, 4);
memcpy(sessionKey + 20, rndB + 12, 4);
break;
case CRYPTO_TYPE_AES128:
memcpy(sessionKey, rndA, 4);
memcpy(sessionKey + 4, rndB, 4);
memcpy(sessionKey + 8, rndA + 12, 4);
memcpy(sessionKey + 12, rndB + 12, 4);
break;
default:
return false;
}
return true;
}

BYTE GetCryptoKeyTypeFromAuthenticateMethod(BYTE authCmdMethod) {
switch (authCmdMethod) {
Expand All @@ -138,8 +169,7 @@ BYTE GetCryptoKeyTypeFromAuthenticateMethod(BYTE authCmdMethod) {
}
}

void InitAESCryptoKeyData(DesfireAESCryptoKey *cryptoKeyData) {
memset(cryptoKeyData, 0x00, sizeof(DesfireAESCryptoKey));
void InitAESCryptoKeyData(void) {
memset(&SessionKey[0], 0x00, CRYPTO_MAX_KEY_SIZE);
memset(&SessionIV[0], 0x00, CRYPTO_MAX_BLOCK_SIZE);
}
Expand Down
14 changes: 7 additions & 7 deletions Firmware/Chameleon-Mini/Application/DESFire/DESFireCrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ This notice must be retained at the top of all source files where indicated.
#define DESFIRE_COMMS_CIPHERTEXT_AES128 (0x04)
#define DESFIRE_DEFAULT_COMMS_STANDARD (DESFIRE_COMMS_PLAINTEXT)

extern BYTE DesfireCommMode;

#define CRYPTO_TYPE_ANY (0x00)
#define CRYPTO_TYPE_DES (0x01)
#define CRYPTO_TYPE_2KTDEA (0x0A)
Expand All @@ -62,11 +64,11 @@ This notice must be retained at the top of all source files where indicated.

/* Key sizes, block sizes (in bytes): */
#define CRYPTO_AES_KEY_SIZE (16)
#define CRYPTO_MAX_KEY_SIZE (24)
#define CRYPTO_MAX_KEY_SIZE (24) // (32) // Make it a multiple of the EEPROM_BLOCK_SIZE
#define CRYPTO_MAX_BLOCK_SIZE (16)
#define DESFIRE_AES_IV_SIZE (CRYPTO_AES_BLOCK_SIZE)
#define DESFIRE_SESSION_KEY_SIZE (CRYPTO_3KTDEA_KEY_SIZE)
#define CRYPTO_CHALLENGE_RESPONSE_BYTES (8)
#define CRYPTO_CHALLENGE_RESPONSE_BYTES (16)

typedef BYTE CryptoKeyBufferType[CRYPTO_MAX_KEY_SIZE];
typedef BYTE CryptoIVBufferType[CRYPTO_MAX_BLOCK_SIZE];
Expand Down Expand Up @@ -94,6 +96,8 @@ BYTE GetCryptoMethodCommSettings(uint8_t cryptoType);
const char *GetCryptoMethodDesc(uint8_t cryptoType);
const char *GetCommSettingsDesc(uint8_t cryptoType);

bool generateSessionKey(uint8_t *sessionKey, uint8_t *rndA, uint8_t *rndB, uint16_t cryptoType);

#define DESFIRE_MAC_LENGTH 4
#define DESFIRE_CMAC_LENGTH 8 // in bytes

Expand All @@ -118,13 +122,9 @@ BYTE GetCryptoKeyTypeFromAuthenticateMethod(BYTE authCmdMethod);

#include "../CryptoAES128.h"

typedef uint8_t DesfireAESCryptoKey[CRYPTO_AES_KEY_SIZE];

extern CryptoAESConfig_t AESCryptoContext;
extern DesfireAESCryptoKey AESCryptoSessionKey;
extern DesfireAESCryptoKey AESCryptoIVBuffer;

void InitAESCryptoKeyData(DesfireAESCryptoKey *cryptoKeyData);
void InitAESCryptoKeyData(void);

typedef void (*CryptoAESCBCFuncType)(uint16_t, void *, void *, uint8_t *, uint8_t *);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ This notice must be retained at the top of all source files where indicated.

#define DESFIRE_FIRMWARE_DEBUGGING (1)

#define DESFIRE_FIRMWARE_BUILD_TIMESTAMP (BUILD_DATE)
#define DESFIRE_FIRMWARE_GIT_COMMIT_ID (COMMIT_ID)
#define DESFIRE_FIRMWARE_REVISION ("0.0.2")
#define DESFIRE_FIRMWARE_PICC_LAYOUT_REVISION (0x02)
#define DESFIRE_FIRMWARE_BUILD_TIMESTAMP PSTR(BUILD_DATE)
#define DESFIRE_FIRMWARE_GIT_COMMIT_ID PSTR(COMMIT_ID)
#define DESFIRE_FIRMWARE_REVISION PSTR("1.0.0-testing")
#define DESFIRE_FIRMWARE_PICC_LAYOUT_REVISION (0x03)

#define DESFIRE_LITTLE_ENDIAN (1)

#define DESFIRE_PICC_STRUCT_PACKING //__attribute__((aligned(1)))
#define DESFIRE_PICC_STRUCT_PACKING __attribute__((aligned(4)))
#define DESFIRE_FIRMWARE_PACKING __attribute__((packed))
#define DESFIRE_FIRMWARE_ALIGNAT __attribute__((aligned(1)))
#define DESFIRE_PICC_ARRAY_ALIGNAT //__attribute__((aligned(1)))
#define DESFIRE_FIRMWARE_ARRAY_ALIGNAT //__attribute__((aligned(1)))
#define DESFIRE_FIRMWARE_ENUM_PACKING //__attribute__((aligned(1)))
#define DESFIRE_FIRMWARE_NOINIT //__attribute__ ((section (".noinit")))
#define DESFIRE_FIRMWARE_ALIGNAT __attribute__((aligned(4)))
#define DESFIRE_PICC_ARRAY_ALIGNAT __attribute__((aligned(4)))
#define DESFIRE_FIRMWARE_ARRAY_ALIGNAT __attribute__((aligned(4)))
#define DESFIRE_FIRMWARE_ENUM_PACKING __attribute__((aligned(4)))
#define DESFIRE_FIRMWARE_NOINIT __attribute__ ((section (".noinit")))

/* Some standard boolean interpreted and other values for types and return values: */
typedef int BOOL;
Expand Down
Loading

0 comments on commit b451e12

Please sign in to comment.