工程参考:https://github.com/bricke/Qt-AES
函数定义如下:
// MixColumns function mixes the columns of the state matrix
//optimized!!
void QAESEncryption::mixColumns()
{
QByteArray::iterator it = m_state->begin();
quint8 tmp, tm, t;
for(int i = 0; i < 16; i += 4){
t = (quint8)it[i];
tmp = (quint8)it[i] ^ (quint8)it[i+1] ^ (quint8)it[i+2] ^ (quint8)it[i+3] ;
tm = xTime( (quint8)it[i] ^ (quint8)it[i+1] );
it[i] = (quint8)it[i] ^ (quint8)tm ^ (quint8)tmp;
tm = xTime( (quint8)it[i+1] ^ (quint8)it[i+2]);
it[i+1] = (quint8)it[i+1] ^ (quint8)tm ^ (quint8)tmp;
tm = xTime( (quint8)it[i+2] ^ (quint8)it[i+3]);
it[i+2] =(quint8)it[i+2] ^ (quint8)tm ^ (quint8)tmp;
tm = xTime((quint8)it[i+3] ^ (quint8)t);
it[i&#