|
-
May 3rd, 2009, 06:44 PM
#1
Error C2440 '=' can not convert
Hi there,
I'm trying to teach myself how to write dlls and plugins and I found an sdk and decided to write an encryption plug-in for it, here's the code:
Code:
// returns encrypted buffer that must be freed
BYTE * __cdecl AESEncrypt_Encrypt(void *pInternal, BYTE *pBuffer, int nBufLen, int *pnOutBufLen)
{
AESEncrypt_DATA *data = (AESEncrypt_DATA*)pInternal;
BYTE *buf;
int i;
buf=(BYTE *)malloc(nBufLen);
data->Nk = data->Nr / 32;
data->Nr = data->Nk + 6;
data->in=pBuffer;
KeyExpansion(data);
Cipher(data);
buf=data->out; // <--- this is the line of the error
*pnOutBufLen=nBufLen;
return buf;
}
typedef unsigned char BYTE;
typedef struct {
unsigned char Key[16];
int Nr;
int Nk;
int Nb;
unsigned char in[16], out[16], state[4][4];
int Rcon[255];
// The array that stores the round keys.
unsigned char RoundKey[240];
} AESEncrypt_DATA;
The error says:
Error C2440 '=' can not convert BYTE to unsigned char [16]
It has been driving me crazy, it's been 2 weeks and I can't figure out why or what I'm doing wrong...
I have included the structure and the typedef as they were laid out in the SDK
I'd greatly appreciate any help or guidance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|