代码拉取完成,页面将自动刷新
//
// Created by wkm on 2024-03-17.
//
#include "AddRoundKey.h"
//定义轮密钥加操作
void AddRoundKey(unsigned char *col, unsigned char *expansionkey, int round)//密匙加
{
//扩展密钥:44*32bit =11*4* 4*8 = 16字节*11轮,每轮用16字节密钥
//第0轮,只进行一次轮密钥加
//第1-10轮,轮密钥加
int x;
for (x = 0; x < 16; x++) { //每1轮操作:4*32bit密钥 = 16个字节密钥
// round << 4 即为 round * 16
col[x] ^= expansionkey[(round << 4) + x];
}
}
//void addRoundKey::prc_addRoundKey() {
// sc_biguint<WIDTH> inKeyOpd, resultKey;
// sc_uint<4> round;
//
// inKeyOpd = inKey.read();
//
// round = 0;
// for (round = 0; round < 11; ++round) {
// int x;
// for (x = 0; x < 16; x++) { //每1轮操作:4*32bit密钥 = 16个字节密钥
// col[x] ^= resultKey[(round << 4) + x];
// }
// }
//
// outKey = resultKey;
//}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。