1 Star 0 Fork 0

很难不呃呃 / AES128Chip

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
AddRoundKey.cpp 964 Bytes
一键复制 编辑 原始数据 按行查看 历史
很难不呃呃 提交于 2024-04-27 18:47 . 整理了输出的过程
//
// 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;
//}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/wang-kangming/aes128-chip.git
git@gitee.com:wang-kangming/aes128-chip.git
wang-kangming
aes128-chip
AES128Chip
master

搜索帮助