Arduino nano (ATmega328P old bootloader) aes128_cbc_enc не шифрует

Всем привет. Программирую на ide Clion (platformIO) используя библиотеку AESLib.h

void crypt(String text){
    Serial.println("Welcome to Encryption");
    uint8_t key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
    uint8_t iv[] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
    int dataLength = text.length() + 1;
    char data[dataLength];
    text.toCharArray(data, dataLength);
    aes128_cbc_enc(key, iv, data, dataLength);
    Serial.println("encrypted:");
    for (int i=0; i<sizeof(data);i++)
    {
        Serial.print(data[i]);
    }
}

crypt("hello");

Консоль возвращает "hello". При этом если использовать:

aes128_enc_single(const uint8_t* key, void* data);

все шифруется нормально.


Ответы (0 шт):