Lines Matching refs:RK
555 uint32_t *RK; in mbedtls_aes_setkey_enc() local
581 ctx->rk = RK = MBEDTLS_PADLOCK_ALIGN16( ctx->buf ); in mbedtls_aes_setkey_enc()
584 ctx->rk = RK = ctx->buf; in mbedtls_aes_setkey_enc()
593 GET_UINT32_LE( RK[i], key, i << 2 ); in mbedtls_aes_setkey_enc()
600 for( i = 0; i < 10; i++, RK += 4 ) in mbedtls_aes_setkey_enc()
602 RK[4] = RK[0] ^ RCON[i] ^ in mbedtls_aes_setkey_enc()
603 ( (uint32_t) FSb[ ( RK[3] >> 8 ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
604 ( (uint32_t) FSb[ ( RK[3] >> 16 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
605 ( (uint32_t) FSb[ ( RK[3] >> 24 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
606 ( (uint32_t) FSb[ ( RK[3] ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
608 RK[5] = RK[1] ^ RK[4]; in mbedtls_aes_setkey_enc()
609 RK[6] = RK[2] ^ RK[5]; in mbedtls_aes_setkey_enc()
610 RK[7] = RK[3] ^ RK[6]; in mbedtls_aes_setkey_enc()
616 for( i = 0; i < 8; i++, RK += 6 ) in mbedtls_aes_setkey_enc()
618 RK[6] = RK[0] ^ RCON[i] ^ in mbedtls_aes_setkey_enc()
619 ( (uint32_t) FSb[ ( RK[5] >> 8 ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
620 ( (uint32_t) FSb[ ( RK[5] >> 16 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
621 ( (uint32_t) FSb[ ( RK[5] >> 24 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
622 ( (uint32_t) FSb[ ( RK[5] ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
624 RK[7] = RK[1] ^ RK[6]; in mbedtls_aes_setkey_enc()
625 RK[8] = RK[2] ^ RK[7]; in mbedtls_aes_setkey_enc()
626 RK[9] = RK[3] ^ RK[8]; in mbedtls_aes_setkey_enc()
627 RK[10] = RK[4] ^ RK[9]; in mbedtls_aes_setkey_enc()
628 RK[11] = RK[5] ^ RK[10]; in mbedtls_aes_setkey_enc()
634 for( i = 0; i < 7; i++, RK += 8 ) in mbedtls_aes_setkey_enc()
636 RK[8] = RK[0] ^ RCON[i] ^ in mbedtls_aes_setkey_enc()
637 ( (uint32_t) FSb[ ( RK[7] >> 8 ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
638 ( (uint32_t) FSb[ ( RK[7] >> 16 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
639 ( (uint32_t) FSb[ ( RK[7] >> 24 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
640 ( (uint32_t) FSb[ ( RK[7] ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
642 RK[9] = RK[1] ^ RK[8]; in mbedtls_aes_setkey_enc()
643 RK[10] = RK[2] ^ RK[9]; in mbedtls_aes_setkey_enc()
644 RK[11] = RK[3] ^ RK[10]; in mbedtls_aes_setkey_enc()
646 RK[12] = RK[4] ^ in mbedtls_aes_setkey_enc()
647 ( (uint32_t) FSb[ ( RK[11] ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
648 ( (uint32_t) FSb[ ( RK[11] >> 8 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
649 ( (uint32_t) FSb[ ( RK[11] >> 16 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
650 ( (uint32_t) FSb[ ( RK[11] >> 24 ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
652 RK[13] = RK[5] ^ RK[12]; in mbedtls_aes_setkey_enc()
653 RK[14] = RK[6] ^ RK[13]; in mbedtls_aes_setkey_enc()
654 RK[15] = RK[7] ^ RK[14]; in mbedtls_aes_setkey_enc()
672 uint32_t *RK; in mbedtls_aes_setkey_dec() local
685 ctx->rk = RK = MBEDTLS_PADLOCK_ALIGN16( ctx->buf ); in mbedtls_aes_setkey_dec()
688 ctx->rk = RK = ctx->buf; in mbedtls_aes_setkey_dec()
707 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
708 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
709 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
710 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
716 *RK++ = AES_RT0( FSb[ ( *SK ) & 0xFF ] ) ^ in mbedtls_aes_setkey_dec()
723 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
724 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
725 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
726 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
815 (X0) = *RK++ ^ AES_FT0( ( (Y0) ) & 0xFF ) ^ \
820 (X1) = *RK++ ^ AES_FT0( ( (Y1) ) & 0xFF ) ^ \
825 (X2) = *RK++ ^ AES_FT0( ( (Y2) ) & 0xFF ) ^ \
830 (X3) = *RK++ ^ AES_FT0( ( (Y3) ) & 0xFF ) ^ \
839 (X0) = *RK++ ^ AES_RT0( ( (Y0) ) & 0xFF ) ^ \
844 (X1) = *RK++ ^ AES_RT0( ( (Y1) ) & 0xFF ) ^ \
849 (X2) = *RK++ ^ AES_RT0( ( (Y2) ) & 0xFF ) ^ \
854 (X3) = *RK++ ^ AES_RT0( ( (Y3) ) & 0xFF ) ^ \
869 uint32_t *RK = ctx->rk; in mbedtls_internal_aes_encrypt() local
876 GET_UINT32_LE( t.X[0], input, 0 ); t.X[0] ^= *RK++; in mbedtls_internal_aes_encrypt()
877 GET_UINT32_LE( t.X[1], input, 4 ); t.X[1] ^= *RK++; in mbedtls_internal_aes_encrypt()
878 GET_UINT32_LE( t.X[2], input, 8 ); t.X[2] ^= *RK++; in mbedtls_internal_aes_encrypt()
879 GET_UINT32_LE( t.X[3], input, 12 ); t.X[3] ^= *RK++; in mbedtls_internal_aes_encrypt()
889 t.X[0] = *RK++ ^ \ in mbedtls_internal_aes_encrypt()
895 t.X[1] = *RK++ ^ \ in mbedtls_internal_aes_encrypt()
901 t.X[2] = *RK++ ^ \ in mbedtls_internal_aes_encrypt()
907 t.X[3] = *RK++ ^ \ in mbedtls_internal_aes_encrypt()
942 uint32_t *RK = ctx->rk; in mbedtls_internal_aes_decrypt() local
949 GET_UINT32_LE( t.X[0], input, 0 ); t.X[0] ^= *RK++; in mbedtls_internal_aes_decrypt()
950 GET_UINT32_LE( t.X[1], input, 4 ); t.X[1] ^= *RK++; in mbedtls_internal_aes_decrypt()
951 GET_UINT32_LE( t.X[2], input, 8 ); t.X[2] ^= *RK++; in mbedtls_internal_aes_decrypt()
952 GET_UINT32_LE( t.X[3], input, 12 ); t.X[3] ^= *RK++; in mbedtls_internal_aes_decrypt()
962 t.X[0] = *RK++ ^ \ in mbedtls_internal_aes_decrypt()
968 t.X[1] = *RK++ ^ \ in mbedtls_internal_aes_decrypt()
974 t.X[2] = *RK++ ^ \ in mbedtls_internal_aes_decrypt()
980 t.X[3] = *RK++ ^ \ in mbedtls_internal_aes_decrypt()