Lines Matching refs:RK
488 uint32_t *RK; in mbedtls_aes_setkey_enc() local
512 ctx->rk = RK = MBEDTLS_PADLOCK_ALIGN16( ctx->buf ); in mbedtls_aes_setkey_enc()
515 ctx->rk = RK = ctx->buf; in mbedtls_aes_setkey_enc()
524 GET_UINT32_LE( RK[i], key, i << 2 ); in mbedtls_aes_setkey_enc()
531 for( i = 0; i < 10; i++, RK += 4 ) in mbedtls_aes_setkey_enc()
533 RK[4] = RK[0] ^ RCON[i] ^ in mbedtls_aes_setkey_enc()
534 ( (uint32_t) FSb[ ( RK[3] >> 8 ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
535 ( (uint32_t) FSb[ ( RK[3] >> 16 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
536 ( (uint32_t) FSb[ ( RK[3] >> 24 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
537 ( (uint32_t) FSb[ ( RK[3] ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
539 RK[5] = RK[1] ^ RK[4]; in mbedtls_aes_setkey_enc()
540 RK[6] = RK[2] ^ RK[5]; in mbedtls_aes_setkey_enc()
541 RK[7] = RK[3] ^ RK[6]; in mbedtls_aes_setkey_enc()
547 for( i = 0; i < 8; i++, RK += 6 ) in mbedtls_aes_setkey_enc()
549 RK[6] = RK[0] ^ RCON[i] ^ in mbedtls_aes_setkey_enc()
550 ( (uint32_t) FSb[ ( RK[5] >> 8 ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
551 ( (uint32_t) FSb[ ( RK[5] >> 16 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
552 ( (uint32_t) FSb[ ( RK[5] >> 24 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
553 ( (uint32_t) FSb[ ( RK[5] ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
555 RK[7] = RK[1] ^ RK[6]; in mbedtls_aes_setkey_enc()
556 RK[8] = RK[2] ^ RK[7]; in mbedtls_aes_setkey_enc()
557 RK[9] = RK[3] ^ RK[8]; in mbedtls_aes_setkey_enc()
558 RK[10] = RK[4] ^ RK[9]; in mbedtls_aes_setkey_enc()
559 RK[11] = RK[5] ^ RK[10]; in mbedtls_aes_setkey_enc()
565 for( i = 0; i < 7; i++, RK += 8 ) in mbedtls_aes_setkey_enc()
567 RK[8] = RK[0] ^ RCON[i] ^ in mbedtls_aes_setkey_enc()
568 ( (uint32_t) FSb[ ( RK[7] >> 8 ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
569 ( (uint32_t) FSb[ ( RK[7] >> 16 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
570 ( (uint32_t) FSb[ ( RK[7] >> 24 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
571 ( (uint32_t) FSb[ ( RK[7] ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
573 RK[9] = RK[1] ^ RK[8]; in mbedtls_aes_setkey_enc()
574 RK[10] = RK[2] ^ RK[9]; in mbedtls_aes_setkey_enc()
575 RK[11] = RK[3] ^ RK[10]; in mbedtls_aes_setkey_enc()
577 RK[12] = RK[4] ^ in mbedtls_aes_setkey_enc()
578 ( (uint32_t) FSb[ ( RK[11] ) & 0xFF ] ) ^ in mbedtls_aes_setkey_enc()
579 ( (uint32_t) FSb[ ( RK[11] >> 8 ) & 0xFF ] << 8 ) ^ in mbedtls_aes_setkey_enc()
580 ( (uint32_t) FSb[ ( RK[11] >> 16 ) & 0xFF ] << 16 ) ^ in mbedtls_aes_setkey_enc()
581 ( (uint32_t) FSb[ ( RK[11] >> 24 ) & 0xFF ] << 24 ); in mbedtls_aes_setkey_enc()
583 RK[13] = RK[5] ^ RK[12]; in mbedtls_aes_setkey_enc()
584 RK[14] = RK[6] ^ RK[13]; in mbedtls_aes_setkey_enc()
585 RK[15] = RK[7] ^ RK[14]; in mbedtls_aes_setkey_enc()
603 uint32_t *RK; in mbedtls_aes_setkey_dec() local
613 ctx->rk = RK = MBEDTLS_PADLOCK_ALIGN16( ctx->buf ); in mbedtls_aes_setkey_dec()
616 ctx->rk = RK = ctx->buf; in mbedtls_aes_setkey_dec()
635 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
636 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
637 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
638 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
644 *RK++ = RT0[ FSb[ ( *SK ) & 0xFF ] ] ^ in mbedtls_aes_setkey_dec()
651 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
652 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
653 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
654 *RK++ = *SK++; in mbedtls_aes_setkey_dec()
665 X0 = *RK++ ^ FT0[ ( Y0 ) & 0xFF ] ^ \
670 X1 = *RK++ ^ FT0[ ( Y1 ) & 0xFF ] ^ \
675 X2 = *RK++ ^ FT0[ ( Y2 ) & 0xFF ] ^ \
680 X3 = *RK++ ^ FT0[ ( Y3 ) & 0xFF ] ^ \
688 X0 = *RK++ ^ RT0[ ( Y0 ) & 0xFF ] ^ \
693 X1 = *RK++ ^ RT0[ ( Y1 ) & 0xFF ] ^ \
698 X2 = *RK++ ^ RT0[ ( Y2 ) & 0xFF ] ^ \
703 X3 = *RK++ ^ RT0[ ( Y3 ) & 0xFF ] ^ \
718 uint32_t *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3; in mbedtls_aes_encrypt() local
720 RK = ctx->rk; in mbedtls_aes_encrypt()
722 GET_UINT32_LE( X0, input, 0 ); X0 ^= *RK++; in mbedtls_aes_encrypt()
723 GET_UINT32_LE( X1, input, 4 ); X1 ^= *RK++; in mbedtls_aes_encrypt()
724 GET_UINT32_LE( X2, input, 8 ); X2 ^= *RK++; in mbedtls_aes_encrypt()
725 GET_UINT32_LE( X3, input, 12 ); X3 ^= *RK++; in mbedtls_aes_encrypt()
735 X0 = *RK++ ^ \ in mbedtls_aes_encrypt()
741 X1 = *RK++ ^ \ in mbedtls_aes_encrypt()
747 X2 = *RK++ ^ \ in mbedtls_aes_encrypt()
753 X3 = *RK++ ^ \ in mbedtls_aes_encrypt()
775 uint32_t *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3; in mbedtls_aes_decrypt() local
777 RK = ctx->rk; in mbedtls_aes_decrypt()
779 GET_UINT32_LE( X0, input, 0 ); X0 ^= *RK++; in mbedtls_aes_decrypt()
780 GET_UINT32_LE( X1, input, 4 ); X1 ^= *RK++; in mbedtls_aes_decrypt()
781 GET_UINT32_LE( X2, input, 8 ); X2 ^= *RK++; in mbedtls_aes_decrypt()
782 GET_UINT32_LE( X3, input, 12 ); X3 ^= *RK++; in mbedtls_aes_decrypt()
792 X0 = *RK++ ^ \ in mbedtls_aes_decrypt()
798 X1 = *RK++ ^ \ in mbedtls_aes_decrypt()
804 X2 = *RK++ ^ \ in mbedtls_aes_decrypt()
810 X3 = *RK++ ^ \ in mbedtls_aes_decrypt()