I've got some to calculate the size of an array. I want to have it dynamically so I don't want to send in the prototype of the function when I call it
I had try some functions, but none of them was good. Here is all functions and variables I had try, with the original array :
unsigned int chnid = 0;
unsigned char aes_key[16] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C};
unsigned char aes_iv[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,0x0F};
Here is the function prototype :
int init(unsigned int *chnid, unsigned char *aes_key, unsigned char *aes_iv)
And here his call :
s32Ret = init(&chnid, aes_key, aes_iv);
All the test I do :
size_t keyLen = sizeof aes_key;
size_t keyLen2 = strlen((char*)aes_key);
size_t keyLen3 = strlen(reinterpret_cast<char *>(aes_key));
And results :
keyLen = 4
keyLen2 = 20
keyLen3 = 20
Could it be possible that my problem is the size_t type, or I must change the call of my init function?