Lines Matching refs:k
286 int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k) in Camellia_Ekeygen() argument
290 k[0] = s0 = GETU32(rawKey); in Camellia_Ekeygen()
291 k[1] = s1 = GETU32(rawKey + 4); in Camellia_Ekeygen()
292 k[2] = s2 = GETU32(rawKey + 8); in Camellia_Ekeygen()
293 k[3] = s3 = GETU32(rawKey + 12); in Camellia_Ekeygen()
296 k[8] = s0 = GETU32(rawKey + 16); in Camellia_Ekeygen()
297 k[9] = s1 = GETU32(rawKey + 20); in Camellia_Ekeygen()
299 k[10] = s2 = ~s0; in Camellia_Ekeygen()
300 k[11] = s3 = ~s1; in Camellia_Ekeygen()
302 k[10] = s2 = GETU32(rawKey + 24); in Camellia_Ekeygen()
303 k[11] = s3 = GETU32(rawKey + 28); in Camellia_Ekeygen()
305 s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3]; in Camellia_Ekeygen()
312 s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3]; in Camellia_Ekeygen()
318 k[4] = s0, k[5] = s1, k[6] = s2, k[7] = s3; in Camellia_Ekeygen()
320 k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3; in Camellia_Ekeygen()
322 k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3; in Camellia_Ekeygen()
324 k[24] = s0, k[25] = s1; in Camellia_Ekeygen()
326 k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3; in Camellia_Ekeygen()
328 k[40] = s1, k[41] = s2, k[42] = s3, k[43] = s0; in Camellia_Ekeygen()
330 k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0; in Camellia_Ekeygen()
332 s0 = k[0], s1 = k[1], s2 = k[2], s3 = k[3]; in Camellia_Ekeygen()
334 k[8] = s0, k[9] = s1, k[10] = s2, k[11] = s3; in Camellia_Ekeygen()
336 k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3; in Camellia_Ekeygen()
338 k[26] = s2, k[27] = s3; in Camellia_Ekeygen()
340 k[32] = s0, k[33] = s1, k[34] = s2, k[35] = s3; in Camellia_Ekeygen()
342 k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3; in Camellia_Ekeygen()
344 k[44] = s0, k[45] = s1, k[46] = s2, k[47] = s3; in Camellia_Ekeygen()
348 k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3; in Camellia_Ekeygen()
349 s0 ^= k[8], s1 ^= k[9], s2 ^= k[10], s3 ^= k[11]; in Camellia_Ekeygen()
353 k[4] = s0, k[5] = s1, k[6] = s2, k[7] = s3; in Camellia_Ekeygen()
355 k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3; in Camellia_Ekeygen()
357 k[40] = s0, k[41] = s1, k[42] = s2, k[43] = s3; in Camellia_Ekeygen()
359 k[64] = s1, k[65] = s2, k[66] = s3, k[67] = s0; in Camellia_Ekeygen()
361 s0 = k[8], s1 = k[9], s2 = k[10], s3 = k[11]; in Camellia_Ekeygen()
363 k[8] = s0, k[9] = s1, k[10] = s2, k[11] = s3; in Camellia_Ekeygen()
365 k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3; in Camellia_Ekeygen()
367 k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3; in Camellia_Ekeygen()
369 k[52] = s1, k[53] = s2, k[54] = s3, k[55] = s0; in Camellia_Ekeygen()
371 s0 = k[12], s1 = k[13], s2 = k[14], s3 = k[15]; in Camellia_Ekeygen()
373 k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3; in Camellia_Ekeygen()
375 k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3; in Camellia_Ekeygen()
377 k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0; in Camellia_Ekeygen()
379 k[56] = s1, k[57] = s2, k[58] = s3, k[59] = s0; in Camellia_Ekeygen()
381 s0 = k[0], s1 = k[1], s2 = k[2], s3 = k[3]; in Camellia_Ekeygen()
383 k[24] = s1, k[25] = s2, k[26] = s3, k[27] = s0; in Camellia_Ekeygen()
385 k[32] = s1, k[33] = s2, k[34] = s3, k[35] = s0; in Camellia_Ekeygen()
387 k[44] = s1, k[45] = s2, k[46] = s3, k[47] = s0; in Camellia_Ekeygen()
389 k[60] = s2, k[61] = s3, k[62] = s0, k[63] = s1; in Camellia_Ekeygen()
408 const u32 *k = keyTable, *kend = keyTable + grandRounds * 16; in Camellia_EncryptBlock_Rounds() local
410 s0 = GETU32(plaintext) ^ k[0]; in Camellia_EncryptBlock_Rounds()
411 s1 = GETU32(plaintext + 4) ^ k[1]; in Camellia_EncryptBlock_Rounds()
412 s2 = GETU32(plaintext + 8) ^ k[2]; in Camellia_EncryptBlock_Rounds()
413 s3 = GETU32(plaintext + 12) ^ k[3]; in Camellia_EncryptBlock_Rounds()
414 k += 4; in Camellia_EncryptBlock_Rounds()
418 Camellia_Feistel(s0, s1, s2, s3, k + 0); in Camellia_EncryptBlock_Rounds()
419 Camellia_Feistel(s2, s3, s0, s1, k + 2); in Camellia_EncryptBlock_Rounds()
420 Camellia_Feistel(s0, s1, s2, s3, k + 4); in Camellia_EncryptBlock_Rounds()
421 Camellia_Feistel(s2, s3, s0, s1, k + 6); in Camellia_EncryptBlock_Rounds()
422 Camellia_Feistel(s0, s1, s2, s3, k + 8); in Camellia_EncryptBlock_Rounds()
423 Camellia_Feistel(s2, s3, s0, s1, k + 10); in Camellia_EncryptBlock_Rounds()
424 k += 12; in Camellia_EncryptBlock_Rounds()
426 if (k == kend) in Camellia_EncryptBlock_Rounds()
434 s1 ^= LeftRotate(s0 & k[0], 1); in Camellia_EncryptBlock_Rounds()
435 s2 ^= s3 | k[3]; in Camellia_EncryptBlock_Rounds()
436 s0 ^= s1 | k[1]; in Camellia_EncryptBlock_Rounds()
437 s3 ^= LeftRotate(s2 & k[2], 1); in Camellia_EncryptBlock_Rounds()
438 k += 4; in Camellia_EncryptBlock_Rounds()
441 s2 ^= k[0], s3 ^= k[1], s0 ^= k[2], s1 ^= k[3]; in Camellia_EncryptBlock_Rounds()
461 const u32 *k = keyTable + grandRounds * 16, *kend = keyTable + 4; in Camellia_DecryptBlock_Rounds() local
463 s0 = GETU32(ciphertext) ^ k[0]; in Camellia_DecryptBlock_Rounds()
464 s1 = GETU32(ciphertext + 4) ^ k[1]; in Camellia_DecryptBlock_Rounds()
465 s2 = GETU32(ciphertext + 8) ^ k[2]; in Camellia_DecryptBlock_Rounds()
466 s3 = GETU32(ciphertext + 12) ^ k[3]; in Camellia_DecryptBlock_Rounds()
470 k -= 12; in Camellia_DecryptBlock_Rounds()
471 Camellia_Feistel(s0, s1, s2, s3, k + 10); in Camellia_DecryptBlock_Rounds()
472 Camellia_Feistel(s2, s3, s0, s1, k + 8); in Camellia_DecryptBlock_Rounds()
473 Camellia_Feistel(s0, s1, s2, s3, k + 6); in Camellia_DecryptBlock_Rounds()
474 Camellia_Feistel(s2, s3, s0, s1, k + 4); in Camellia_DecryptBlock_Rounds()
475 Camellia_Feistel(s0, s1, s2, s3, k + 2); in Camellia_DecryptBlock_Rounds()
476 Camellia_Feistel(s2, s3, s0, s1, k + 0); in Camellia_DecryptBlock_Rounds()
478 if (k == kend) in Camellia_DecryptBlock_Rounds()
486 k -= 4; in Camellia_DecryptBlock_Rounds()
487 s1 ^= LeftRotate(s0 & k[2], 1); in Camellia_DecryptBlock_Rounds()
488 s2 ^= s3 | k[1]; in Camellia_DecryptBlock_Rounds()
489 s0 ^= s1 | k[3]; in Camellia_DecryptBlock_Rounds()
490 s3 ^= LeftRotate(s2 & k[0], 1); in Camellia_DecryptBlock_Rounds()
493 k -= 4; in Camellia_DecryptBlock_Rounds()
494 s2 ^= k[0], s3 ^= k[1], s0 ^= k[2], s1 ^= k[3]; in Camellia_DecryptBlock_Rounds()