Lines Matching refs:ROUNDS
36 int rijndaelKeySched(word8 k[MAXKC][4], word8 W[MAXROUNDS+1][4][4], int ROUNDS) {
46 int KC = ROUNDS - 6;
54 for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
64 while (r < ROUNDS + 1) { /* while not enough round key material calculated */
89 for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
103 int rijndaelKeyEncToDec(word8 W[MAXROUNDS+1][4][4], int ROUNDS) {
107 for (r = 1; r < ROUNDS; r++) {
142 int rijndaelEncrypt(word8 in[16], word8 out[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS) {
178 for (r = 1; r < ROUNDS-1; r++) {
202 *((word32*)temp[0]) = *((word32*)(b )) ^ *((word32*)rk[ROUNDS-1][0]);
203 *((word32*)temp[1]) = *((word32*)(b+ 4)) ^ *((word32*)rk[ROUNDS-1][1]);
204 *((word32*)temp[2]) = *((word32*)(b+ 8)) ^ *((word32*)rk[ROUNDS-1][2]);
205 *((word32*)temp[3]) = *((word32*)(b+12)) ^ *((word32*)rk[ROUNDS-1][3]);
222 *((word32*)(b )) ^= *((word32*)rk[ROUNDS][0]);
223 *((word32*)(b+ 4)) ^= *((word32*)rk[ROUNDS][1]);
224 *((word32*)(b+ 8)) ^= *((word32*)rk[ROUNDS][2]);
225 *((word32*)(b+12)) ^= *((word32*)rk[ROUNDS][3]);
237 * Encrypt only a certain number of rounds.
240 int rijndaelEncryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds) {
244 /* make number of rounds sane */
245 if (rounds > ROUNDS) {
246 rounds = ROUNDS;
254 for (r = 1; (r <= rounds) && (r < ROUNDS); r++) {
276 if (rounds == ROUNDS) {
294 *((word32*)a[0]) = *((word32*)temp[0]) ^ *((word32*)rk[ROUNDS][0]);
295 *((word32*)a[1]) = *((word32*)temp[1]) ^ *((word32*)rk[ROUNDS][1]);
296 *((word32*)a[2]) = *((word32*)temp[2]) ^ *((word32*)rk[ROUNDS][2]);
297 *((word32*)a[3]) = *((word32*)temp[3]) ^ *((word32*)rk[ROUNDS][3]);
307 int rijndaelDecrypt(word8 in[16], word8 out[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS) {
323 *((word32*)temp[0]) = *((word32*)(a )) ^ *((word32*)rk[ROUNDS][0]);
324 *((word32*)temp[1]) = *((word32*)(a+ 4)) ^ *((word32*)rk[ROUNDS][1]);
325 *((word32*)temp[2]) = *((word32*)(a+ 8)) ^ *((word32*)rk[ROUNDS][2]);
326 *((word32*)temp[3]) = *((word32*)(a+12)) ^ *((word32*)rk[ROUNDS][3]);
344 for (r = ROUNDS-1; r > 1; r--) {
403 * Decrypt only a certain number of rounds.
409 int rijndaelDecryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds) {
413 /* make number of rounds sane */
414 if (rounds > ROUNDS) {
415 rounds = ROUNDS;
418 *(word32 *)a[0] ^= *(word32 *)rk[ROUNDS][0];
419 *(word32 *)a[1] ^= *(word32 *)rk[ROUNDS][1];
420 *(word32 *)a[2] ^= *(word32 *)rk[ROUNDS][2];
421 *(word32 *)a[3] ^= *(word32 *)rk[ROUNDS][3];
439 /* ROUNDS-1 ordinary rounds */
440 for (r = ROUNDS-1; r > rounds; r--) {
487 if (rounds == 0) {