Changeset 41b53c2 for tools/traceanon/rijndael.c
 Timestamp:
 11/03/05 17:17:41 (16 years ago)
 Branches:
 4.0.1hotfixes, cachetimestamps, develop, dpdkndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc4.0.1, rc4.0.2, rc4.0.3, rc4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
 Children:
 fe3d755
 Parents:
 117e83b
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

tools/traceanon/rijndael.c
r49f147b r41b53c2 1059 1059 for(i = numBlocks;i > 0;i) 1060 1060 { 1061 encrypt(input,outBuffer);1061 r_encrypt(input,outBuffer); 1062 1062 input += 16; 1063 1063 outBuffer += 16; … … 1069 1069 ((UINT32*)block)[2] = ((UINT32*)m_initVector)[2] ^ ((UINT32*)input)[2]; 1070 1070 ((UINT32*)block)[3] = ((UINT32*)m_initVector)[3] ^ ((UINT32*)input)[3]; 1071 encrypt(block,outBuffer);1071 r_encrypt(block,outBuffer); 1072 1072 input += 16; 1073 1073 for(i = numBlocks  1;i > 0;i) … … 1078 1078 ((UINT32*)block)[3] = ((UINT32*)outBuffer)[3] ^ ((UINT32*)input)[3]; 1079 1079 outBuffer += 16; 1080 encrypt(block,outBuffer);1080 r_encrypt(block,outBuffer); 1081 1081 input += 16; 1082 1082 } … … 1099 1099 *((UINT32*)(block+ 8)) = *((UINT32*)iv[2]); 1100 1100 *((UINT32*)(block+12)) = *((UINT32*)iv[3]); 1101 encrypt(block,block);1101 r_encrypt(block,block); 1102 1102 outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7); 1103 1103 iv[0][0] = (iv[0][0] << 1)  (iv[0][1] >> 7); … … 1145 1145 for(i = numBlocks; i > 0; i) 1146 1146 { 1147 encrypt(input, outBuffer);1147 r_encrypt(input, outBuffer); 1148 1148 input += 16; 1149 1149 outBuffer += 16; … … 1153 1153 memcpy(block, input, 16  padLen); 1154 1154 memset(block + 16  padLen, padLen, padLen); 1155 encrypt(block,outBuffer);1155 r_encrypt(block,outBuffer); 1156 1156 break; 1157 1157 case CBC: … … 1163 1163 ((UINT32*)block)[2] = ((UINT32*)input)[2] ^ ((UINT32*)iv)[2]; 1164 1164 ((UINT32*)block)[3] = ((UINT32*)input)[3] ^ ((UINT32*)iv)[3]; 1165 encrypt(block, outBuffer);1165 r_encrypt(block, outBuffer); 1166 1166 iv = outBuffer; 1167 1167 input += 16; … … 1176 1176 block[i] = (UINT8)padLen ^ iv[i]; 1177 1177 } 1178 encrypt(block,outBuffer);1178 r_encrypt(block,outBuffer); 1179 1179 break; 1180 1180 default: … … 1203 1203 for (i = numBlocks; i > 0; i) 1204 1204 { 1205 decrypt(input,outBuffer);1205 r_decrypt(input,outBuffer); 1206 1206 input += 16; 1207 1207 outBuffer += 16; … … 1219 1219 for (i = numBlocks; i > 0; i) 1220 1220 { 1221 decrypt(input, block);1221 r_decrypt(input, block); 1222 1222 ((UINT32*)block)[0] ^= *((UINT32*)iv[0]); 1223 1223 ((UINT32*)block)[1] ^= *((UINT32*)iv[1]); … … 1254 1254 *((UINT32*)(block+ 8)) = *((UINT32*)iv[2]); 1255 1255 *((UINT32*)(block+12)) = *((UINT32*)iv[3]); 1256 encrypt(block, block);1256 r_encrypt(block, block); 1257 1257 iv[0][0] = (iv[0][0] << 1)  (iv[0][1] >> 7); 1258 1258 iv[0][1] = (iv[0][1] << 1)  (iv[0][2] >> 7); … … 1302 1302 for (i = numBlocks  1; i > 0; i) 1303 1303 { 1304 decrypt(input, outBuffer);1304 r_decrypt(input, outBuffer); 1305 1305 input += 16; 1306 1306 outBuffer += 16; 1307 1307 } 1308 1308 1309 decrypt(input, block);1309 r_decrypt(input, block); 1310 1310 padLen = block[15]; 1311 1311 if (padLen >= 16)return RIJNDAEL_CORRUPTED_DATA; … … 1321 1321 for (i = numBlocks  1; i > 0; i) 1322 1322 { 1323 decrypt(input, block);1323 r_decrypt(input, block); 1324 1324 ((UINT32*)block)[0] ^= iv[0]; 1325 1325 ((UINT32*)block)[1] ^= iv[1]; … … 1332 1332 } 1333 1333 /* last block */ 1334 decrypt(input, block);1334 r_decrypt(input, block); 1335 1335 ((UINT32*)block)[0] ^= iv[0]; 1336 1336 ((UINT32*)block)[1] ^= iv[1]; … … 1456 1456 } 1457 1457 1458 void encrypt(const UINT8 a[16], UINT8 b[16])1458 void r_encrypt(const UINT8 a[16], UINT8 b[16]) 1459 1459 { 1460 1460 int r; … … 1531 1531 } 1532 1532 1533 void decrypt(const UINT8 a[16], UINT8 b[16])1533 void r_decrypt(const UINT8 a[16], UINT8 b[16]) 1534 1534 { 1535 1535 int r;
Note: See TracChangeset
for help on using the changeset viewer.