In Globals I set a Byte Array to
In the C section I can convert and use it (works by using the converted ivu variable)
Now I would like to access ivx directly from globals:
Works fine for all other variables but not for (uint8_t*)b4r_main::_ivx->data which gives valid but incorrect values. Must be unsigned char iv[16]
Can someone please point me in the right direction?
Method (from the ESP32 docs):
B4X:
Public ivx(16) As Byte = Array As Byte(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
In the C section I can convert and use it (works by using the converted ivu variable)
B4X:
char *ivc = (char*)b4r_main::_ivx->data;
uint8_t ivu[16];
//Set IV
int i;
for( i = 0; i < 16; i++ )
{
ivu[i]=ivc[i];
}
Now I would like to access ivx directly from globals:
B4X:
esp_aes_crypt_cbc( &ctx, ESP_AES_ENCRYPT, b4r_main::_dec_len, (uint8_t*)b4r_main::_ivx->data, (uint8_t*)b4r_main::_aesdecrypted->data, (uint8_t*)b4r_main::_aesencrypted->data );
Works fine for all other variables but not for (uint8_t*)b4r_main::_ivx->data which gives valid but incorrect values. Must be unsigned char iv[16]
Can someone please point me in the right direction?
Method (from the ESP32 docs):
B4X:
int esp_aes_crypt_cbc( esp_aes_context *ctx,
int mode,
size_t length,
unsigned char iv[16],
const unsigned char *input,
unsigned char *output )
{
...