Here is an example of the code.
The cache is placed between the CPU and Enc/Dec Engine, and the data size is 
adjusted by setting the cacheline to 128 bits.
if(pkt->isWrite()){
    unsigned char dec1[16];
    for (int i = 0; i < 16; ++i){
        dec1[i] = *(pkt->getConstPtr<uint8_t>() + i);
    }
    unsigned char key[16] = {
            0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 
0x88, 0x09, 0xcf, 0x4f, 0x3c};
    unsigned char enc1[16] = {};
    AES128_ECB_Encrypt(key, dec1, enc1);
    for (int i = 0; i < 16; ++i){
        *(pkt->getPtr<uint8_t>() + i) = enc1[i];
    }
}
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to