it is for embedded smart card system..
i'm using smartdeck c compiler..
well i did some mistake at the declaration part but i have correct it this is te example for the declaration :
Code:
typedef struct message
{
unsigned char msg_asal[6];
unsigned char msg2[2];
unsigned char check[4];
unsigned long sum;
} apdu_data3;
#pragma melpublic
//unsigned char publicData[136];
union
{
apdu_data pData;
apdu_data2 pData2;
apdu_data3 msg;
unsigned char pEncdata[16];
unsigned char pkeysat[CLkeysat-1];
unsigned int pKira1[1];
unsigned int pKira2[1];
} apdu_group1;
and this is the line where i implement the checksum library :
Code:
memcpy(apdu_group1.msg.msg2, apdu_group1.msg.msg_asal, 2);
memcpy(apdu_group1.msg.check, apdu_group1.msg.msg_asal+2, 4);
CHECKSUM(2, apdu_group1.msg.msg2, apdu_group1.msg.sum); //line 157