code 1
uint8_t ucAESKey_BASE64[] = "oFqTg0a0VrjiVU76M1WRVw==";
uint8_t *pucAESKey_BASE64;
pucAESKey_BASE64 = ucAESKey_BASE64;
code 2
uint8_t *pucAESKey_BASE64 = "oFqTg0a0VrjiVU76M1WRVw==";
I use mbedtls_base64_decode() to decode base64 string ,the API of mbedTLS.
int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen,
const unsigned char *src, size_t slen )
My program like this:
mbedtls_base64_decode(ucAESKey, sizeof(ucAESKey), &olen,
pucAESKey_BASE64, strlen(pucAESKey_BASE64));
If the parameter *src use code 2 , the output is
00 00 00 83 46 b4 56 b8 e2 55 4e fa 33 55 91 57
if *src use code 1, the output is
a0 5a 93 83 46 b4 56 b8 e2 55 4e fa 33 55 91 57
and this is correct. Why?