Lines Matching refs:k

376 static void copy_and_key( void *d, const void *s, const void *k )  in copy_and_key()  argument
379 ((uint32_t*)d)[ 0] = ((uint32_t*)s)[ 0] ^ ((uint32_t*)k)[ 0]; in copy_and_key()
380 ((uint32_t*)d)[ 1] = ((uint32_t*)s)[ 1] ^ ((uint32_t*)k)[ 1]; in copy_and_key()
381 ((uint32_t*)d)[ 2] = ((uint32_t*)s)[ 2] ^ ((uint32_t*)k)[ 2]; in copy_and_key()
382 ((uint32_t*)d)[ 3] = ((uint32_t*)s)[ 3] ^ ((uint32_t*)k)[ 3]; in copy_and_key()
384 ((uint8_t*)d)[ 0] = ((uint8_t*)s)[ 0] ^ ((uint8_t*)k)[ 0]; in copy_and_key()
385 ((uint8_t*)d)[ 1] = ((uint8_t*)s)[ 1] ^ ((uint8_t*)k)[ 1]; in copy_and_key()
386 ((uint8_t*)d)[ 2] = ((uint8_t*)s)[ 2] ^ ((uint8_t*)k)[ 2]; in copy_and_key()
387 ((uint8_t*)d)[ 3] = ((uint8_t*)s)[ 3] ^ ((uint8_t*)k)[ 3]; in copy_and_key()
388 ((uint8_t*)d)[ 4] = ((uint8_t*)s)[ 4] ^ ((uint8_t*)k)[ 4]; in copy_and_key()
389 ((uint8_t*)d)[ 5] = ((uint8_t*)s)[ 5] ^ ((uint8_t*)k)[ 5]; in copy_and_key()
390 ((uint8_t*)d)[ 6] = ((uint8_t*)s)[ 6] ^ ((uint8_t*)k)[ 6]; in copy_and_key()
391 ((uint8_t*)d)[ 7] = ((uint8_t*)s)[ 7] ^ ((uint8_t*)k)[ 7]; in copy_and_key()
392 ((uint8_t*)d)[ 8] = ((uint8_t*)s)[ 8] ^ ((uint8_t*)k)[ 8]; in copy_and_key()
393 ((uint8_t*)d)[ 9] = ((uint8_t*)s)[ 9] ^ ((uint8_t*)k)[ 9]; in copy_and_key()
394 ((uint8_t*)d)[10] = ((uint8_t*)s)[10] ^ ((uint8_t*)k)[10]; in copy_and_key()
395 ((uint8_t*)d)[11] = ((uint8_t*)s)[11] ^ ((uint8_t*)k)[11]; in copy_and_key()
396 ((uint8_t*)d)[12] = ((uint8_t*)s)[12] ^ ((uint8_t*)k)[12]; in copy_and_key()
397 ((uint8_t*)d)[13] = ((uint8_t*)s)[13] ^ ((uint8_t*)k)[13]; in copy_and_key()
398 ((uint8_t*)d)[14] = ((uint8_t*)s)[14] ^ ((uint8_t*)k)[14]; in copy_and_key()
399 ((uint8_t*)d)[15] = ((uint8_t*)s)[15] ^ ((uint8_t*)k)[15]; in copy_and_key()
402 xor_block(d, k); in copy_and_key()
406 static void add_round_key( uint8_t d[N_BLOCK], const uint8_t k[N_BLOCK] ) in add_round_key()
408 xor_block(d, k); in add_round_key()
674 static void update_encrypt_key_128( uint8_t k[N_BLOCK], uint8_t *rc )
677 k[0] ^= s_box(k[13]) ^ *rc;
678 k[1] ^= s_box(k[14]);
679 k[2] ^= s_box(k[15]);
680 k[3] ^= s_box(k[12]);
685 k[cc + 0] ^= k[cc - 4];
686 k[cc + 1] ^= k[cc - 3];
687 k[cc + 2] ^= k[cc - 2];
688 k[cc + 3] ^= k[cc - 1];
728 static void update_decrypt_key_128( uint8_t k[N_BLOCK], uint8_t *rc )
733 k[cc + 0] ^= k[cc - 4];
734 k[cc + 1] ^= k[cc - 3];
735 k[cc + 2] ^= k[cc - 2];
736 k[cc + 3] ^= k[cc - 1];
739 k[0] ^= s_box(k[13]) ^ *rc;
740 k[1] ^= s_box(k[14]);
741 k[2] ^= s_box(k[15]);
742 k[3] ^= s_box(k[12]);
781 static void update_encrypt_key_256( uint8_t k[2 * N_BLOCK], uint8_t *rc )
784 k[0] ^= s_box(k[29]) ^ *rc;
785 k[1] ^= s_box(k[30]);
786 k[2] ^= s_box(k[31]);
787 k[3] ^= s_box(k[28]);
792 k[cc + 0] ^= k[cc - 4];
793 k[cc + 1] ^= k[cc - 3];
794 k[cc + 2] ^= k[cc - 2];
795 k[cc + 3] ^= k[cc - 1];
798 k[16] ^= s_box(k[12]);
799 k[17] ^= s_box(k[13]);
800 k[18] ^= s_box(k[14]);
801 k[19] ^= s_box(k[15]);
805 k[cc + 0] ^= k[cc - 4];
806 k[cc + 1] ^= k[cc - 3];
807 k[cc + 2] ^= k[cc - 2];
808 k[cc + 3] ^= k[cc - 1];
861 static void update_decrypt_key_256( uint8_t k[2 * N_BLOCK], uint8_t *rc )
866 k[cc + 0] ^= k[cc - 4];
867 k[cc + 1] ^= k[cc - 3];
868 k[cc + 2] ^= k[cc - 2];
869 k[cc + 3] ^= k[cc - 1];
872 k[16] ^= s_box(k[12]);
873 k[17] ^= s_box(k[13]);
874 k[18] ^= s_box(k[14]);
875 k[19] ^= s_box(k[15]);
879 k[cc + 0] ^= k[cc - 4];
880 k[cc + 1] ^= k[cc - 3];
881 k[cc + 2] ^= k[cc - 2];
882 k[cc + 3] ^= k[cc - 1];
886 k[0] ^= s_box(k[29]) ^ *rc;
887 k[1] ^= s_box(k[30]);
888 k[2] ^= s_box(k[31]);
889 k[3] ^= s_box(k[28]);