Lines Matching refs:rk
28 static int rijndaelKeySetupDec(u32 rk[], const u8 cipherKey[], int keyBits) in rijndaelKeySetupDec() argument
34 Nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits); in rijndaelKeySetupDec()
39 temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp; in rijndaelKeySetupDec()
40 temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp; in rijndaelKeySetupDec()
41 temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp; in rijndaelKeySetupDec()
42 temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp; in rijndaelKeySetupDec()
47 rk += 4; in rijndaelKeySetupDec()
49 rk[j] = TD0_(TE4((rk[j] >> 24) )) ^ in rijndaelKeySetupDec()
50 TD1_(TE4((rk[j] >> 16) & 0xff)) ^ in rijndaelKeySetupDec()
51 TD2_(TE4((rk[j] >> 8) & 0xff)) ^ in rijndaelKeySetupDec()
52 TD3_(TE4((rk[j] ) & 0xff)); in rijndaelKeySetupDec()
61 u32 *rk; in aes_decrypt_init() local
63 rk = os_malloc(AES_PRIV_SIZE); in aes_decrypt_init()
64 if (rk == NULL) in aes_decrypt_init()
66 res = rijndaelKeySetupDec(rk, key, len * 8); in aes_decrypt_init()
68 os_free(rk); in aes_decrypt_init()
71 rk[AES_PRIV_NR_POS] = res; in aes_decrypt_init()
72 return rk; in aes_decrypt_init()
75 static void rijndaelDecrypt(const u32 rk[/*44*/], int Nr, const u8 ct[16], in rijndaelDecrypt() argument
87 s0 = GETU32(ct ) ^ rk[0]; in rijndaelDecrypt()
88 s1 = GETU32(ct + 4) ^ rk[1]; in rijndaelDecrypt()
89 s2 = GETU32(ct + 8) ^ rk[2]; in rijndaelDecrypt()
90 s3 = GETU32(ct + 12) ^ rk[3]; in rijndaelDecrypt()
93 d##0 = TD0(s##0) ^ TD1(s##3) ^ TD2(s##2) ^ TD3(s##1) ^ rk[4 * i]; \ in rijndaelDecrypt()
94 d##1 = TD0(s##1) ^ TD1(s##0) ^ TD2(s##3) ^ TD3(s##2) ^ rk[4 * i + 1]; \ in rijndaelDecrypt()
95 d##2 = TD0(s##2) ^ TD1(s##1) ^ TD2(s##0) ^ TD3(s##3) ^ rk[4 * i + 2]; \ in rijndaelDecrypt()
96 d##3 = TD0(s##3) ^ TD1(s##2) ^ TD2(s##1) ^ TD3(s##0) ^ rk[4 * i + 3] in rijndaelDecrypt()
118 rk += Nr << 2; in rijndaelDecrypt()
126 rk += 8; in rijndaelDecrypt()
140 s0 = TD41(t0) ^ TD42(t3) ^ TD43(t2) ^ TD44(t1) ^ rk[0]; in rijndaelDecrypt()
142 s1 = TD41(t1) ^ TD42(t0) ^ TD43(t3) ^ TD44(t2) ^ rk[1]; in rijndaelDecrypt()
144 s2 = TD41(t2) ^ TD42(t1) ^ TD43(t0) ^ TD44(t3) ^ rk[2]; in rijndaelDecrypt()
146 s3 = TD41(t3) ^ TD42(t2) ^ TD43(t1) ^ TD44(t0) ^ rk[3]; in rijndaelDecrypt()
153 u32 *rk = ctx; in aes_decrypt() local
154 rijndaelDecrypt(ctx, rk[AES_PRIV_NR_POS], crypt, plain); in aes_decrypt()