Lines Matching refs:k
334 static void copy_and_key(void* d, const void* s, const void* k) { in copy_and_key() argument
336 ((uint_32t*)d)[0] = ((uint_32t*)s)[0] ^ ((uint_32t*)k)[0]; in copy_and_key()
337 ((uint_32t*)d)[1] = ((uint_32t*)s)[1] ^ ((uint_32t*)k)[1]; in copy_and_key()
338 ((uint_32t*)d)[2] = ((uint_32t*)s)[2] ^ ((uint_32t*)k)[2]; in copy_and_key()
339 ((uint_32t*)d)[3] = ((uint_32t*)s)[3] ^ ((uint_32t*)k)[3]; in copy_and_key()
341 ((uint_8t*)d)[0] = ((uint_8t*)s)[0] ^ ((uint_8t*)k)[0]; in copy_and_key()
342 ((uint_8t*)d)[1] = ((uint_8t*)s)[1] ^ ((uint_8t*)k)[1]; in copy_and_key()
343 ((uint_8t*)d)[2] = ((uint_8t*)s)[2] ^ ((uint_8t*)k)[2]; in copy_and_key()
344 ((uint_8t*)d)[3] = ((uint_8t*)s)[3] ^ ((uint_8t*)k)[3]; in copy_and_key()
345 ((uint_8t*)d)[4] = ((uint_8t*)s)[4] ^ ((uint_8t*)k)[4]; in copy_and_key()
346 ((uint_8t*)d)[5] = ((uint_8t*)s)[5] ^ ((uint_8t*)k)[5]; in copy_and_key()
347 ((uint_8t*)d)[6] = ((uint_8t*)s)[6] ^ ((uint_8t*)k)[6]; in copy_and_key()
348 ((uint_8t*)d)[7] = ((uint_8t*)s)[7] ^ ((uint_8t*)k)[7]; in copy_and_key()
349 ((uint_8t*)d)[8] = ((uint_8t*)s)[8] ^ ((uint_8t*)k)[8]; in copy_and_key()
350 ((uint_8t*)d)[9] = ((uint_8t*)s)[9] ^ ((uint_8t*)k)[9]; in copy_and_key()
351 ((uint_8t*)d)[10] = ((uint_8t*)s)[10] ^ ((uint_8t*)k)[10]; in copy_and_key()
352 ((uint_8t*)d)[11] = ((uint_8t*)s)[11] ^ ((uint_8t*)k)[11]; in copy_and_key()
353 ((uint_8t*)d)[12] = ((uint_8t*)s)[12] ^ ((uint_8t*)k)[12]; in copy_and_key()
354 ((uint_8t*)d)[13] = ((uint_8t*)s)[13] ^ ((uint_8t*)k)[13]; in copy_and_key()
355 ((uint_8t*)d)[14] = ((uint_8t*)s)[14] ^ ((uint_8t*)k)[14]; in copy_and_key()
356 ((uint_8t*)d)[15] = ((uint_8t*)s)[15] ^ ((uint_8t*)k)[15]; in copy_and_key()
359 xor_block(d, k); in copy_and_key()
363 static void add_round_key(uint_8t d[N_BLOCK], const uint_8t k[N_BLOCK]) { in add_round_key()
364 xor_block(d, k); in add_round_key()
639 static void update_encrypt_key_128(uint_8t k[N_BLOCK], uint_8t* rc) {
642 k[0] ^= s_box(k[13]) ^ *rc;
643 k[1] ^= s_box(k[14]);
644 k[2] ^= s_box(k[15]);
645 k[3] ^= s_box(k[12]);
649 k[cc + 0] ^= k[cc - 4];
650 k[cc + 1] ^= k[cc - 3];
651 k[cc + 2] ^= k[cc - 2];
652 k[cc + 3] ^= k[cc - 1];
695 static void update_decrypt_key_128(uint_8t k[N_BLOCK], uint_8t* rc) {
699 k[cc + 0] ^= k[cc - 4];
700 k[cc + 1] ^= k[cc - 3];
701 k[cc + 2] ^= k[cc - 2];
702 k[cc + 3] ^= k[cc - 1];
705 k[0] ^= s_box(k[13]) ^ *rc;
706 k[1] ^= s_box(k[14]);
707 k[2] ^= s_box(k[15]);
708 k[3] ^= s_box(k[12]);
749 static void update_encrypt_key_256(uint_8t k[2 * N_BLOCK], uint_8t* rc) {
752 k[0] ^= s_box(k[29]) ^ *rc;
753 k[1] ^= s_box(k[30]);
754 k[2] ^= s_box(k[31]);
755 k[3] ^= s_box(k[28]);
759 k[cc + 0] ^= k[cc - 4];
760 k[cc + 1] ^= k[cc - 3];
761 k[cc + 2] ^= k[cc - 2];
762 k[cc + 3] ^= k[cc - 1];
765 k[16] ^= s_box(k[12]);
766 k[17] ^= s_box(k[13]);
767 k[18] ^= s_box(k[14]);
768 k[19] ^= s_box(k[15]);
771 k[cc + 0] ^= k[cc - 4];
772 k[cc + 1] ^= k[cc - 3];
773 k[cc + 2] ^= k[cc - 2];
774 k[cc + 3] ^= k[cc - 1];
827 static void update_decrypt_key_256(uint_8t k[2 * N_BLOCK], uint_8t* rc) {
831 k[cc + 0] ^= k[cc - 4];
832 k[cc + 1] ^= k[cc - 3];
833 k[cc + 2] ^= k[cc - 2];
834 k[cc + 3] ^= k[cc - 1];
837 k[16] ^= s_box(k[12]);
838 k[17] ^= s_box(k[13]);
839 k[18] ^= s_box(k[14]);
840 k[19] ^= s_box(k[15]);
843 k[cc + 0] ^= k[cc - 4];
844 k[cc + 1] ^= k[cc - 3];
845 k[cc + 2] ^= k[cc - 2];
846 k[cc + 3] ^= k[cc - 1];
850 k[0] ^= s_box(k[29]) ^ *rc;
851 k[1] ^= s_box(k[30]);
852 k[2] ^= s_box(k[31]);
853 k[3] ^= s_box(k[28]);